Skip to content

Commit

Permalink
Make the tutorial less fat
Browse files Browse the repository at this point in the history
  • Loading branch information
laffra committed Apr 27, 2024
1 parent 73f6193 commit ad8d5ba
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
8 changes: 4 additions & 4 deletions ltk/ltk.css
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@
top: -1000px;
left: -1000px;
background: lightyellow;
border: 5px solid gray;
border: 3px solid orange;
border-radius: 15px;
overflow: hidden;
padding: 10px;
Expand All @@ -452,9 +452,9 @@

.ltk-step-marker {
position: absolute;
width: 5px;
height: 5px;
background: gray;
width: 3px;
height: 3px;
background: orange;
z-index: 10000;
}

Expand Down
23 changes: 14 additions & 9 deletions ltk/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -1028,36 +1028,41 @@ def fix(self):

def add_markers(self):
self.content.css("visibility", "visible")
# the top part
ltk.find("body").append(ltk.Div()
.addClass("ltk-step-marker")
.css("left", self.widget.offset().left)
.css("top", self.widget.offset().top)
.css("width", self.widget.outerWidth())
.css("width", self.widget.outerWidth() + 1)
)
# the bottom part
ltk.find("body").append(ltk.Div()
.addClass("ltk-step-marker")
.css("left", self.widget.offset().left)
.css("top", self.widget.offset().top + self.widget.outerHeight() - 3)
.css("width", self.widget.outerWidth())
.css("top", self.widget.offset().top + self.widget.outerHeight() - 2)
.css("width", self.widget.outerWidth() + 1)
)
# the left part
ltk.find("body").append(ltk.Div()
.addClass("ltk-step-marker")
.css("left", self.widget.offset().left - 2)
.css("left", self.widget.offset().left)
.css("top", self.widget.offset().top)
.css("height", self.widget.outerHeight() + 2)
.css("height", self.widget.outerHeight())
)
# the right part
ltk.find("body").append(ltk.Div()
.addClass("ltk-step-marker")
.css("left", self.widget.offset().left + self.widget.outerWidth() - 3)
.css("left", self.widget.offset().left + self.widget.outerWidth() - 1)
.css("top", self.widget.offset().top)
.css("height", self.widget.outerHeight() + 2)
.css("height", self.widget.outerHeight())
)
# the connector
ltk.find("body").append(ltk.Div()
.addClass("ltk-step-marker")
.css("left", self.widget.offset().left + self.widget.outerWidth() - 3)
.css("left", self.widget.offset().left + self.widget.outerWidth() - 1)
.css("top", self.widget.offset().top + 12)
.css("width", 32)
.css("height", 7)
.css("height", 3)
)

def hide(self):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "pyscript-ltk"
version = "0.1.35"
version = "0.1.37"
description = "A little toolkit for writing UIs in PyScript"
readme = "README.md"
authors = [{ name = "Chris Laffra", email = "chris@chrislaffra.com" }]
Expand Down

0 comments on commit ad8d5ba

Please sign in to comment.