diff --git a/tabcounter/__init__.py b/tabcounter/__init__.py
index 9ed1ceb..2dbbe37 100644
--- a/tabcounter/__init__.py
+++ b/tabcounter/__init__.py
@@ -34,7 +34,8 @@ class tabCounter(Falkon.PluginInterface, QtCore.QObject):
def init(self, state, settingsPath):
self.config = Config(
settingsFile=os.path.join(settingsPath, "tabcounter", "settings.ini"),
- displayType=DISPLAY_TYPE.LOADED_AND_ALL
+ displayType=DISPLAY_TYPE.LOADED_AND_ALL,
+ enableTooltip=False
)
self.config.load()
@@ -61,8 +62,7 @@ class tabCounter(Falkon.PluginInterface, QtCore.QObject):
def onMainWindowCreated(self, window):
- labelWidget = Label(window, self.config.displayType)
- self.config.displayTypeChanged.connect(labelWidget.displayTypeChanged)
+ labelWidget = Label(window, self.config)
window.navigationBar().addWidget(labelWidget, labelWidget.id(), labelWidget.name())
self.panelWidgets[window] = labelWidget
diff --git a/tabcounter/config.py b/tabcounter/config.py
index e1c2052..75befae 100644
--- a/tabcounter/config.py
+++ b/tabcounter/config.py
@@ -23,16 +23,18 @@ from PySide2.QtCore import QObject, Signal, QSettings
class Config(QObject):
displayTypeChanged = Signal(int)
+ enableTooltipChanged = Signal(bool)
settingsFileChanged = Signal(str)
configLoaded = Signal()
configSaved = Signal()
- def __init__(self, displayType=None, settingsFile=None):
+ def __init__(self, displayType=None, settingsFile=None, enableTooltip=None):
super().__init__()
self._displayType = displayType
self._settingsFile = settingsFile
+ self._enableTooltip = enableTooltip
def load(self):
if not self.settingsFile:
@@ -44,6 +46,7 @@ class Config(QObject):
settings.beginGroup("Config")
self.displayType = int(settings.value("displayType", self.displayType))
+ self.enableTooltip = settings.value("enableTooltip", self.enableTooltip) == "true"
settings.endGroup()
self.configLoaded.emit()
@@ -58,6 +61,7 @@ class Config(QObject):
settings.beginGroup("Config")
settings.setValue("displayType", self.displayType)
+ settings.setValue("enableTooltip", self.enableTooltip)
settings.endGroup()
settings.sync()
@@ -78,6 +82,20 @@ class Config(QObject):
self._displayType = displayType
self.displayTypeChanged.emit(displayType)
+ @property
+ def enableTooltip(self):
+ return self._enableTooltip
+
+ @enableTooltip.setter
+ def enableTooltip(self, enableTooltip):
+ if not isinstance(enableTooltip, bool):
+ return
+ if self._enableTooltip == enableTooltip:
+ return
+
+ self._enableTooltip = enableTooltip
+ self.enableTooltipChanged.emit(enableTooltip)
+
@property
def settingsFile(self):
return self._settingsFile
diff --git a/tabcounter/label.py b/tabcounter/label.py
index 7a09206..d436425 100644
--- a/tabcounter/label.py
+++ b/tabcounter/label.py
@@ -16,24 +16,26 @@
# along with this program. If not, see
{tr_windows}: | {windows} |
{tr_active}: | {tabs_active} |
{tr_inactive}: | {tabs_inactive} |
{tr_all}: | {tabs_all} |