src/eric7/WebBrowser/Navigation/NavigationContainer.py

Wed, 13 Jul 2022 14:55:47 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 13 Jul 2022 14:55:47 +0200
branch
eric7
changeset 9221
bf71ee032bb4
parent 9209
b99e7fd55fd3
child 9473
3f23dbf37dbe
permissions
-rw-r--r--

Reformatted the source code using the 'Black' utility.

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
8318
962bce857696 Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8312
diff changeset
10 from PyQt6.QtWidgets import QWidget, QVBoxLayout, QSizePolicy
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)

eric ide

mercurial