mirror of
https://github.com/SoongNoonien/mpdevil.git
synced 2023-08-10 21:12:44 +03:00
simplified FocusFrame
This commit is contained in:
parent
4ccda70197
commit
6a8bd1e823
15
bin/mpdevil
15
bin/mpdevil
@ -1308,10 +1308,7 @@ class AutoSizedIcon(Gtk.Image):
|
|||||||
class FocusFrame(Gtk.Overlay):
|
class FocusFrame(Gtk.Overlay):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
self._frame=Gtk.Frame(no_show_all=True)
|
||||||
self._frame=Gtk.Frame()
|
|
||||||
self._frame.set_no_show_all(True)
|
|
||||||
self._widget=None
|
|
||||||
|
|
||||||
# css
|
# css
|
||||||
style_context=self._frame.get_style_context()
|
style_context=self._frame.get_style_context()
|
||||||
@ -1332,14 +1329,8 @@ class FocusFrame(Gtk.Overlay):
|
|||||||
|
|
||||||
def set_widget(self, widget):
|
def set_widget(self, widget):
|
||||||
self._widget=widget
|
self._widget=widget
|
||||||
widget.connect("focus-in-event", self._on_focus_in_event)
|
self._widget.connect("focus-in-event", lambda *args: self._frame.show())
|
||||||
widget.connect("focus-out-event", self._on_focus_out_event)
|
self._widget.connect("focus-out-event", lambda *args: self._frame.hide())
|
||||||
|
|
||||||
def _on_focus_in_event(self, *args):
|
|
||||||
self._frame.show()
|
|
||||||
|
|
||||||
def _on_focus_out_event(self, *args):
|
|
||||||
self._frame.hide()
|
|
||||||
|
|
||||||
class SongPopover(Gtk.Popover):
|
class SongPopover(Gtk.Popover):
|
||||||
def __init__(self, song, relative, x, y):
|
def __init__(self, song, relative, x, y):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user