mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-13 05:45:49 +00:00
prepare to release 1.10.3
+ added ability to set transparent background
This commit is contained in:
@ -55,6 +55,7 @@ class ConfigDefinition:
|
||||
settings.set('font_style', str(self.configpage['appearance'].ui.comboBox_style.currentText()))
|
||||
settings.set('font_weight', self.configpage['appearance'].ui.spinBox_weight.value())
|
||||
|
||||
settings.set('background', self.configpage['advanced'].ui.checkBox_background.checkState())
|
||||
settings.set('layout', self.configpage['advanced'].ui.checkBox_layout.checkState())
|
||||
settings.set('popup', self.configpage['advanced'].ui.checkBox_popup.checkState())
|
||||
settings.set('left_stretch', self.configpage['advanced'].ui.checkBox_leftStretch.checkState())
|
||||
@ -154,6 +155,7 @@ class ConfigDefinition:
|
||||
self.configpage['appearance'].ui.comboBox_style.setCurrentIndex(1)
|
||||
self.configpage['appearance'].ui.spinBox_weight.setValue(settings.get('font_weight', 400).toInt()[0])
|
||||
|
||||
self.configpage['advanced'].ui.checkBox_background.setCheckState(settings.get('background', 2).toInt()[0])
|
||||
self.configpage['advanced'].ui.checkBox_layout.setCheckState(settings.get('layout', 0).toInt()[0])
|
||||
self.configpage['advanced'].ui.checkBox_popup.setCheckState(settings.get('popup', 2).toInt()[0])
|
||||
self.configpage['advanced'].ui.checkBox_leftStretch.setCheckState(settings.get('left_stretch', 2).toInt()[0])
|
||||
|
@ -96,12 +96,10 @@ class pyTextWidget(plasmascript.Applet):
|
||||
self.timer = QTimer()
|
||||
QObject.connect(self.timer, SIGNAL("timeout()"), self.startPolling)
|
||||
|
||||
self.theme = Plasma.Svg(self)
|
||||
self.initTooltip()
|
||||
self.reInit()
|
||||
self.applet.setLayout(self.ptm['layout'])
|
||||
self.theme = Plasma.Svg(self)
|
||||
self.theme.setImagePath("widgets/background")
|
||||
self.setBackgroundHints(Plasma.Applet.DefaultBackground)
|
||||
|
||||
self.setHasConfigurationInterface(True)
|
||||
|
||||
@ -694,6 +692,19 @@ class pyTextWidget(plasmascript.Applet):
|
||||
self.startPolling()
|
||||
|
||||
|
||||
def setTransparentBackground(self, hasBackground=2):
|
||||
"""function to set background to the widget"""
|
||||
if self.debug: qDebug("[PTM] [main.py] [setTransparentBackground]")
|
||||
if self.debug: qDebug("[PTM] [main.py] [setTransparentBackground] : Run function with hasBackground '%s'" %(hasBackground))
|
||||
if (hasBackground == 2):
|
||||
self.theme.setImagePath("widgets/background")
|
||||
self.setBackgroundHints(Plasma.Applet.DefaultBackground)
|
||||
else:
|
||||
self.theme.setImagePath("")
|
||||
self.setBackgroundHints(Plasma.Applet.NoBackground)
|
||||
|
||||
|
||||
|
||||
def setNetdev(self):
|
||||
"""function to set network device"""
|
||||
if self.debug: qDebug("[PTM] [main.py] [setNetdev]")
|
||||
|
@ -49,6 +49,7 @@ class Reinit():
|
||||
ptmVars['adv']['acDev'] = str(settings.get('ac_device', '/sys/class/power_supply/AC/online'))
|
||||
ptmVars['adv']['acOnline'] = str(settings.get('ac_online', '(*)'))
|
||||
ptmVars['adv']['acOffline'] = str(settings.get('ac_offline', '( )'))
|
||||
ptmVars['adv']['background'] = settings.get('background', 2).toInt()[0]
|
||||
ptmVars['adv']['batDev'] = str(settings.get('battery_device', '/sys/class/power_supply/BAT0/capacity'))
|
||||
ptmVars['adv']['customTime'] = str(settings.get('custom_time', '$hh:$mm'))
|
||||
ptmVars['adv']['customUptime'] = str(settings.get('custom_uptime', '$dd,$hh,$mm'))
|
||||
@ -91,6 +92,7 @@ class Reinit():
|
||||
if self.debug: qDebug("[PTM] [reinit.py] [reinit] : Returns names '%s'" %(ptmNames))
|
||||
self.parent.applySettings('names', ptmNames)
|
||||
|
||||
self.parent.setTransparentBackground(ptmVars['adv']['background'])
|
||||
self.parent.createLayout(ptmVars['adv']['layout'], ptmVars['adv']['leftStretch'])
|
||||
ptmVars['formats'] = {}
|
||||
ptmVars['tooltip']['required'] = []
|
||||
|
Reference in New Issue
Block a user