Mon, 07 Nov 2022 17:19:58 +0100
Corrected/acknowledged some bad import style and removed some obsolete code.
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1 | # -*- coding: utf-8 -*- |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2 | |
8881
54e42bc2437a
Updated copyright for 2022.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8318
diff
changeset
|
3 | # Copyright (c) 2017 - 2022 Detlev Offenbach <detlev@die-offenbachs.de> |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
4 | # |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
5 | |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
6 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
7 | Module implementing the navigation container widget. |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
8 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
9 | |
9473
3f23dbf37dbe
Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9221
diff
changeset
|
10 | from PyQt6.QtWidgets import QSizePolicy, QVBoxLayout, QWidget |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
11 | |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
12 | |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
13 | class NavigationContainer(QWidget): |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
14 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
15 | Class implementing the navigation container widget. |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
16 | """ |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
17 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
18 | def __init__(self, parent=None): |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
19 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
20 | Constructor |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
21 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
22 | @param parent reference to the parent widget |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
23 | @type QWidget |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
24 | """ |
8218
7c09585bd960
Applied some more code simplifications suggested by the new Simplify checker (super(Foo, self) => super()).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8143
diff
changeset
|
25 | super().__init__(parent) |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
26 | self.setObjectName("navigationcontainer") |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
27 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
28 | self.__layout = QVBoxLayout(self) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
29 | self.__layout.setContentsMargins(0, 0, 0, 0) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
30 | self.__layout.setSpacing(0) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
31 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
32 | self.setLayout(self.__layout) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
33 | self.setSizePolicy(QSizePolicy.Policy.Preferred, QSizePolicy.Policy.Maximum) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
34 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
35 | def addWidget(self, widget): |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
36 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
37 | Public method to add a widget to the container. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
38 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
39 | @param widget reference to the widget to be added |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
40 | @type QWidget |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
41 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
42 | self.__layout.addWidget(widget) |