Skip to content

Commit 4b99d35

Browse files
committed
[docs] Add GroupBoxRule import line to docs
1 parent c1468f9 commit 4b99d35

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

qtile_extras/widget/groupbox2.py

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -612,20 +612,23 @@ class GroupBox2(base._Widget, base.MarginMixin, base.PaddingMixin):
612612
613613
Block:
614614
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.
617617
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
619619
and cannot be set by rules.
620620
621621
Line:
622622
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:
626626
627627
.. code:: python
628628
629+
from qtile_extras.widget.groupbox2 import GroupBoxRule
630+
631+
629632
GroupBoxRule.LINE_TOP | GroupBoxRule.LINE_BOTTOM
630633
631634
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):
652655
653656
.. code:: python
654657
658+
from qtile_extras.widget.groupbox2 import GroupBoxRule
659+
660+
655661
def draw_red_square(box):
656662
657663
w = 10
@@ -680,6 +686,9 @@ def draw_red_square(box):
680686
681687
.. code:: python
682688
689+
from qtile_extras.widget.groupbox2 import GroupBoxRule
690+
691+
683692
GroupBoxRule(text_colour="00ffff").when(focused=False, occupied=True)
684693
# ^ ^
685694
# Format set via constructor Conditions set via when() method
@@ -731,6 +740,9 @@ def draw_red_square(box):
731740
732741
.. code:: python
733742
743+
from qtile_extras.widget.groupbox2 import GroupBoxRule
744+
745+
734746
def has_vlc(rule, box):
735747
for win in box.group.windows:
736748
if "VLC" in win.name:
@@ -747,6 +759,9 @@ def has_vlc(rule, box):
747759
748760
.. code:: python
749761
762+
from qtile_extras.widget.groupbox2 import GroupBoxRule
763+
764+
750765
def set_label(rule, box):
751766
if box.focused:
752767
rule.text = "◉"
@@ -771,6 +786,9 @@ def set_label(rule, box):
771786
772787
.. code:: python
773788
789+
from qtile_extras.widget.groupbox2 import GroupBoxRule
790+
791+
774792
rules = [
775793
GroupBoxRule(block_colour="009999").when(screen=GroupBoxRule.SCREEN_THIS),
776794
GroupBoxRule(block_colour="999999").when(occupied=True),

0 commit comments

Comments
 (0)