This pins mypy to their current release, 0.930. Downstream users such as
packagers running `tox` for tests will now definitely pass for as long
as our own CI passed on master. We'll have to bump our mypy version when
there are releases, though no harm done if we miss some releases.
`poll()` method was modifying `self.text` in place before returning the
value. However, `self.text` is a property setter which sets the layout
text. The widget should only update the text value by returning the
value from `poll()`.
There is a bug where focussing static windows fails because
`win.ftm_handle` for the static window is accessed in
`Core.focus_window` but this attribute doesn't exist on static windows.
This change sets the attribute on static windows and uses it to enable
close requests via the protocol. Other requests don't make sense for
static windows (i.e. maximise, minimise etc) so are not listened for.
Wayland backend internal windows use a fixed-size buffer that gets
replaced when the window is resized. Drawers are saving the window's
texture upon creation but are not using new buffers when the window
creates a new one. Instead, this makes Drawers always get the buffer
from the window so that it's always drawing to the correct buffer.
This fixes the TreeTab panel which appears to be broken under Wayland.
It will also be causing problems where internal window resizing is
required.
This adds Python 3.10 to tox and github actions, and runs the non-test
tox envs (mypy, lint etc) with Python 3.10.
This change only adds the new env, and does not remove py37. For the
time being it might be worth supporting py37 while we can, along with
pypy which is only compatible with python 3.7.
A couple of mypy failures have cropped up recently. This addresses
both:
1) CommandObject.command can return None rather than Callable
2) alpha value in rgb gives a tuple of (int, int, int, float)
- Instead of always deleting the first section, the targeted section is deleted
- Targeted section is also deleted from Root.sections so another section with the same name can be added
Many of the widget tests instantiate a `Bar` and override some
attributes and methods. Let's move that highly duplicate code into a
function to make things neater.
Currently widgets are grouped into blocks by splitting the list of
widgets on stretch widgets, and the position of each of these blocks on
the bar is centred such that the the blocks are distributed equally
across the bar.
If you have 2 consecutive stretch widgets configured, this can cause
expected effects where between them you have an empty block containing 0
widgets. This is amongst the blocks distributed equally, which can make
other blocks appear shifted and is confusing. Consider:
```py
widgets = [Left(), WindowName(), Spacer(), Centred(), Spacer(), Right()]
```
Here one might expect the `Centred()` widget to be centred but it will
not, because `WindowName` is a stretch widget, there are actually four
blocks, where the second between `WindowName` and `Spacer` is empty.
This puts `Centred` at 2/3 rather tahn 1/2 across the bar.
This is hard to track down between `Spacer` is invisible and looks like
part of `WindowName`, and the boundary is unclear causing issues with
mouse clicks going to the wrong widget.
This commit makes any number of consecutive stretch widgets be
considered together for the positioning of these blocks and makes them
split the space betwee blocks amongst them. In the example above this
means that positioning is calculated is if there was no first `Spacer`,
and then after that is done, it gets half of `WindowName`s length and
`WindowName` gets only half, correctly centreing `Centred` as would be
expected.
While the obvious question is "what if a user wants two adjacent stretch
widgets", the rationale for implementing this solution (and forcing such
users to stick a 0-width widget between those adjacent stretch widgets)
is that there isn't really a use-case for doing so - how would you
distribute space among them?
Fixes#2487.
This is uninformative for the user and it's bad practice to user
assertions for runtime flow control. Users may have runtime assertions
disabled e.g. by running with `python -O`.
This lets Qtile start up with the rest of the config even if a widget
fails this test, as it is caught in the `_configure` handling in
`Bar`. The issue with nosetests is no longer an issue as nosetests is no
longer used.
This PR enables TextBox widgets (and widgets that inherit
from this class) to be displayed in vertical bars.
Text on the left hand bar will read from bottom to top while
text on the right hand bar will read from top to bottom.
* Thermal zone monitoring for modern linux kernels.
* Widget description
* Thermal zone widget unit test
* Error handling
* Error handling and logging
* Using full thermal zone path as default zone value.
* Unit test update
* Remove unneeded print command
* Custumization over the output.
* Empty trailing lines removed
* Zone file path overhead removed
* Thermal zone widget trailing line removed
* Pep8 codestyle
* Colors
* Simplied condition statements, exact crit value covered
* Functionally to hide the widget for non-critical values
* Changelog formatting fixed
* Docstring
* Separate format for critical values
* Optimizing try/except code
* Using FakeLayout class to set the self.layout.colour and pass the test.
* isort
* Gap between imports
Co-authored-by: Ilyas Arinov <ilyas.arinov@aitudala.kz>
StatusNotifier._configure returns immediately if the widget is
configured, but this stops a new drawer object being created.
This, in turn, creates issues in `qtile-extras` when injecting
decoration code.
See: https://github.com/elParaguayo/qtile-extras/issues/12
`timeout_add` will now return a handle to the timer so that they
can be cancelled individually. Timers are added to a list and
all scheduled timers in the list will be cancelled when `finalize`
is called.
Closes#3042
By using a variable called 'fmt' which is also used by
`base._TextBox`, the string formatting happense twice.
This can be fixed by removing the formatting within
Pomodoro and just letting the base class handle it.
Closes#3070
Click, Drag, Key and KeyChord now get another argument: a swallow boolean.
Possibly options:
- True: Execute the command of the (mouse) key binding and do not pass the key
to the focused window
- False: Execute the command of the (mouse) key binding and pass the key to
the focused window
Fixes#324 and implements the feature request in #2587
Co-authored-by: m-col <mcol@posteo.net>
This is a frequently asked question so fits perfectly 😄
The implementations here are minimal but can serve as a starting points
if users want more specific behaviour (e.g. if you want to use
`toscreen(toggle=True)` then it does get a bit more complicated.)
Similarly this demonstrates some of what users can customise so if they
want to write a binding that scrolls between groups bound to a screen
they have a starting point of how to go about doing that.
This adds supports for the wlr_foreign_toplevel_management_v1 protocol.
This provides an interface through which clients such as status bars and
other WM utilities can control windows belonging to regular clients.
This provides similar functionality as seen in X via e.g. xdotool,
wmctrl to manipulate windows in some ways.
Requires pywlroots 0.14.10
Adds two basic tests for the StatusNotifier widget:
1) Check that icon is added and removed from widget
2) Check that left-clicking the widget triggers the
item's "Activate" method.
There's probably more parts of the widget that should
be tested but this is a good start.