Skip to content

Commit

Permalink
Connect step markers to the step
Browse files Browse the repository at this point in the history
  • Loading branch information
laffra committed Mar 7, 2024
1 parent 8171b86 commit 1bd0375
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
6 changes: 3 additions & 3 deletions ltk/ltk.css
Original file line number Diff line number Diff line change
Expand Up @@ -450,9 +450,9 @@

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

Expand Down
28 changes: 17 additions & 11 deletions ltk/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,6 @@ def __init__(self, widget, content):
self.appendTo(ltk.find("body"))
self.width = self.width()
self.height = self.height()
self.draggable()

def show(self):
left = self.widget.offset().left + self.widget.outerWidth() + 28
Expand All @@ -990,33 +989,40 @@ def show(self):
"top": top,
"width": self.width + 5,
"height": self.height,
}), 250, ltk.proxy(lambda: self.content.css("visibility", "visible")))
self.add_marker()
}), 250, ltk.proxy(lambda: self.add_markers()))

def add_marker(self):
def add_markers(self):
self.content.css("visibility", "visible")
ltk.find("body").append(ltk.Div()
.addClass("ltk-step-marker")
.css("left", self.widget.offset().left)
.css("top", self.widget.offset().top - 2)
.css("top", self.widget.offset().top)
.css("width", self.widget.outerWidth())
)
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())
.css("top", self.widget.offset().top + self.widget.outerHeight() - 3)
.css("width", self.widget.outerWidth())
)
ltk.find("body").append(ltk.Div()
.addClass("ltk-step-marker")
.css("left", self.widget.offset().left - 2)
.css("top", self.widget.offset().top - 2)
.css("height", self.widget.outerHeight() + 4)
.css("top", self.widget.offset().top)
.css("height", self.widget.outerHeight() + 2)
)
ltk.find("body").append(ltk.Div()
.addClass("ltk-step-marker")
.css("left", self.widget.offset().left + self.widget.outerWidth())
.css("top", self.widget.offset().top - 2)
.css("height", self.widget.outerHeight() + 4)
.css("left", self.widget.offset().left + self.widget.outerWidth() - 3)
.css("top", self.widget.offset().top)
.css("height", self.widget.outerHeight() + 2)
)
ltk.find("body").append(ltk.Div()
.addClass("ltk-step-marker")
.css("left", self.widget.offset().left + self.widget.outerWidth() - 3)
.css("top", self.widget.offset().top + 12)
.css("width", 32)
.css("height", 7)
)

def hide(self):
Expand Down

0 comments on commit 1bd0375

Please sign in to comment.