qutebrowser / qutebrowser

A keyboard-driven, vim-like browser based on Python and Qt.
https://www.qutebrowser.org/
GNU General Public License v3.0
9.45k stars 1.01k forks source link

Spike: refactor disable/enable logic for statusbar widgets via composition #8240

Open pylbrecht opened 1 week ago

pylbrecht commented 1 week ago

DISCLAIMER

Super duper WIP changes ahead.


I just want to see what problems arise when using composition over inheritance, as suggested by @The-Compiler in https://github.com/qutebrowser/qutebrowser/issues/7407#issue-1382023382.

There is a lot of unaddressed ugliness (e.g. widget.widget everywhere) in this commit. I just started with moving QLabel into TextBase.widget. Then fixing failing tests one by one with the easiest solution (e.g. widget.widget); I even marked one test with xfail because I could not quickly figure out why it was failing.

My hope is to get a better feel for what belongs to QWidget and what belongs to TextBase (or its subclasses).


Relates to #7407