Small tweaks for new navbar and fallback for older qtile on work laptop
This commit is contained in:
parent
e4b40d40b1
commit
dfcb366241
3 changed files with 60 additions and 28 deletions
|
|
@ -19,8 +19,22 @@ class KuroBar(bar.Bar):
|
|||
),
|
||||
]
|
||||
|
||||
def process_pointer_enter(self, x: int, y: int) -> None:
|
||||
super().process_pointer_enter(x=x, y=y)
|
||||
cur_type: str = "docked"
|
||||
|
||||
def _set_bg_transparent(self):
|
||||
self.background = self.background_normal
|
||||
# GroupBox Widget background color
|
||||
for widget in self.widgets:
|
||||
if isinstance(widget, GroupBox):
|
||||
if len(widget.highlight_color) in [6, 7]:
|
||||
widget.highlight_color = widget.highlight_color + "88"
|
||||
else:
|
||||
widget.highlight_color = widget.highlight_color[:-2] + "88"
|
||||
logger.warning(f"Highlight: {widget.highlight_color}")
|
||||
self.drawer.clear(self.background)
|
||||
self.draw()
|
||||
|
||||
def _set_bg_opaque(self):
|
||||
self.background = self.background_hover
|
||||
# GroupBox Widget background color
|
||||
for widget in self.widgets:
|
||||
|
|
@ -33,16 +47,24 @@ class KuroBar(bar.Bar):
|
|||
self.drawer.clear(self.background)
|
||||
self.draw()
|
||||
|
||||
|
||||
def process_pointer_enter(self, x: int, y: int) -> None:
|
||||
super().process_pointer_enter(x=x, y=y)
|
||||
if self.cur_type == "floating":
|
||||
self._set_bg_opaque()
|
||||
|
||||
def process_pointer_leave(self, x: int, y: int) -> None:
|
||||
super().process_pointer_leave(x=x, y=y)
|
||||
self.background = self.background_normal
|
||||
# GroupBox Widget background color
|
||||
for widget in self.widgets:
|
||||
if isinstance(widget, GroupBox):
|
||||
if len(widget.highlight_color) in [6, 7]:
|
||||
widget.highlight_color = widget.highlight_color + "88"
|
||||
else:
|
||||
widget.highlight_color = widget.highlight_color[:-2] + "88"
|
||||
logger.warning(f"Highlight: {widget.highlight_color}")
|
||||
self.drawer.clear(self.background)
|
||||
self.draw()
|
||||
if self.cur_type == "floating":
|
||||
self._set_bg_transparent()
|
||||
|
||||
def update_bar_type(self, new_type: str):
|
||||
if new_type not in ["docked", "floating"]:
|
||||
return
|
||||
self.cur_type = new_type
|
||||
if new_type == "floating":
|
||||
self.margin = [8, 8, 0, 8]
|
||||
self._set_bg_transparent()
|
||||
else:
|
||||
self.margin = [0, 0, 0, 0]
|
||||
self._set_bg_opaque()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue