@@ -612,20 +612,23 @@ class GroupBox2(base._Widget, base.MarginMixin, base.PaddingMixin):
612
612
613
613
Block:
614
614
615
- Block is a rectangle that can be filled (with `block_colour`) and/or have an outline (with `block_border_width` and
616
- `block_border_colour`). The corners of the rectangle can be curved by setting the `block_corner_radius` value.
615
+ Block is a rectangle that can be filled (with `` block_colour`` ) and/or have an outline (with `` block_border_width` ` and
616
+ `` block_border_colour`` ). The corners of the rectangle can be curved by setting the `` block_corner_radius` ` value.
617
617
618
- The block is positioned by using the `margin(_x)` and `margin_y` attributes. NB Currently, these are global for the widget
618
+ The block is positioned by using the `` margin(_x)`` and `` margin_y` ` attributes. NB Currently, these are global for the widget
619
619
and cannot be set by rules.
620
620
621
621
Line:
622
622
623
- Line is a straight line on the edge of the widget. A line will be drawn at the bottom of the box by default (when a `line_colour`
624
- and `line_width have been set). The position of lines can be changed by setting the `line_position` attribute with
625
- a LinePosition flag. For example to drawn lines at the top and bottom of the box you would set the `line_position` value to:
623
+ Line is a straight line on the edge of the widget. A line will be drawn at the bottom of the box by default (when a `` line_colour` `
624
+ and `` line_width`` have been set). The position of lines can be changed by setting the `` line_position` ` attribute with
625
+ a `` LinePosition`` flag. For example to drawn lines at the top and bottom of the box you would set the `` line_position` ` value to:
626
626
627
627
.. code:: python
628
628
629
+ from qtile_extras.widget.groupbox2 import GroupBoxRule
630
+
631
+
629
632
GroupBoxRule.LINE_TOP | GroupBoxRule.LINE_BOTTOM
630
633
631
634
NB the line will be rendered at the edge of the box i.e. it is not currently offset by the margin value.
@@ -652,6 +655,9 @@ class GroupBox2(base._Widget, base.MarginMixin, base.PaddingMixin):
652
655
653
656
.. code:: python
654
657
658
+ from qtile_extras.widget.groupbox2 import GroupBoxRule
659
+
660
+
655
661
def draw_red_square(box):
656
662
657
663
w = 10
@@ -680,6 +686,9 @@ def draw_red_square(box):
680
686
681
687
.. code:: python
682
688
689
+ from qtile_extras.widget.groupbox2 import GroupBoxRule
690
+
691
+
683
692
GroupBoxRule(text_colour="00ffff").when(focused=False, occupied=True)
684
693
# ^ ^
685
694
# Format set via constructor Conditions set via when() method
@@ -731,6 +740,9 @@ def draw_red_square(box):
731
740
732
741
.. code:: python
733
742
743
+ from qtile_extras.widget.groupbox2 import GroupBoxRule
744
+
745
+
734
746
def has_vlc(rule, box):
735
747
for win in box.group.windows:
736
748
if "VLC" in win.name:
@@ -747,6 +759,9 @@ def has_vlc(rule, box):
747
759
748
760
.. code:: python
749
761
762
+ from qtile_extras.widget.groupbox2 import GroupBoxRule
763
+
764
+
750
765
def set_label(rule, box):
751
766
if box.focused:
752
767
rule.text = "◉"
@@ -771,6 +786,9 @@ def set_label(rule, box):
771
786
772
787
.. code:: python
773
788
789
+ from qtile_extras.widget.groupbox2 import GroupBoxRule
790
+
791
+
774
792
rules = [
775
793
GroupBoxRule(block_colour="009999").when(screen=GroupBoxRule.SCREEN_THIS),
776
794
GroupBoxRule(block_colour="999999").when(occupied=True),
0 commit comments