mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-04-24 15:37:23 +00:00
New release 1.1.3
widget: + added font weight * edited font setup in widget - now font-family works normaly * small bug fix %) configure window: + added font weight setup
This commit is contained in:
parent
e847f97fb4
commit
005c5cba54
Binary file not shown.
@ -38,8 +38,13 @@ class pyTextWidget(plasmascript.Applet):
|
||||
self.settings.set('font_size', self.font_size)
|
||||
self.font_color = str(self.configpage.ui.kcolorcombo.color().name())
|
||||
self.settings.set('font_color', self.font_color)
|
||||
self.font_style = str(self.configpage.ui.lineEdit_style.text())
|
||||
if (self.configpage.ui.comboBox_style.currentIndex() == 0):
|
||||
self.font_style = 'normal'
|
||||
else:
|
||||
self.font_style = 'italic'
|
||||
self.settings.set('font_style', self.font_style)
|
||||
self.font_weight = int(self.configpage.ui.spinBox_weight.value())
|
||||
self.settings.set('font_weight', self.font_weight)
|
||||
|
||||
# disconnecting from source and clear layout
|
||||
if (self.cpuBool == 1):
|
||||
@ -162,11 +167,16 @@ class pyTextWidget(plasmascript.Applet):
|
||||
self.configpage = ConfigWindow(self, self.settings)
|
||||
|
||||
font = QFont(str(self.settings.get('font_family', 'Terminus')), int(self.settings.get('font_size', 12)), 50)
|
||||
self.configpage.ui.spinBox_interval.setValue(int(self.settings.get('interval', '2000')))
|
||||
self.configpage.ui.spinBox_interval.setValue(int(self.settings.get('interval', 2000)))
|
||||
self.configpage.ui.fontComboBox.setCurrentFont(font)
|
||||
self.configpage.ui.spinBox_fontSize.setValue(int(self.settings.get('font_size', 12)))
|
||||
self.configpage.ui.kcolorcombo.setColor(QColor(str(self.settings.get('font_color', '#000000'))))
|
||||
self.configpage.ui.lineEdit_style.setText(str(self.settings.get('font_style', 'normal')))
|
||||
font = str(self.settings.get('font_style', 'normal'))
|
||||
if (font == 'normal'):
|
||||
self.configpage.ui.comboBox_style.setCurrentIndex(0)
|
||||
else:
|
||||
self.configpage.ui.comboBox_style.setCurrentIndex(1)
|
||||
self.configpage.ui.spinBox_weight.setValue(int(self.settings.get('font_weight', 400)))
|
||||
|
||||
if (self.cpuBool == 1):
|
||||
self.configpage.ui.checkBox_cpu.setCheckState(2)
|
||||
@ -236,10 +246,10 @@ class pyTextWidget(plasmascript.Applet):
|
||||
self.configpage.ui.lineEdit_net.setEnabled(True)
|
||||
self.configpage.ui.comboBox_numNet.setEnabled(True)
|
||||
else:
|
||||
self.configpage.ui.checkBox_swap.setCheckState(0)
|
||||
self.configpage.ui.checkBox_net.setCheckState(0)
|
||||
self.configpage.ui.slider_net.setDisabled(True)
|
||||
self.configpage.ui.comboBox_numNet.setDisabled(True)
|
||||
self.configpage.ui.lineEdit_swap.setDisabled(True)
|
||||
self.configpage.ui.lineEdit_net.setDisabled(True)
|
||||
self.configpage.ui.comboBox_numNet.setCurrentIndex(int(self.settings.get('num_dev', 0)))
|
||||
self.configpage.ui.lineEdit_net.setText(str(self.settings.get('netNonFormat', '[net: $netKB/s]')))
|
||||
|
||||
@ -269,10 +279,10 @@ class pyTextWidget(plasmascript.Applet):
|
||||
self.font_size = int(self.settings.get('font_size', 12))
|
||||
self.font_color = str(self.settings.get('font_color', '#000000'))
|
||||
self.font_style = str(self.settings.get('font_style', 'normal'))
|
||||
self.formatLine = "<html><head/><body style=\" font-family:\'" + self.font_family + "\'; font-size:" + str(self.font_size)
|
||||
self.formatLine = self.formatLine +"pt; font-style:" + self.font_style +";\">"
|
||||
self.formatLine = self.formatLine + "<p align=\"center\"><span style=\" color:" + self.font_color + ";\"><pre>$LINE"
|
||||
self.formatLine = self.formatLine + "</pre></span></p></body></html>"
|
||||
self.font_weight = int(self.settings.get('font_weight', 400))
|
||||
self.formatLine = "<pre><p align=\"center\"><span style=\" font-family:'" + self.font_family + "'; font-style:" + self.font_style
|
||||
self.formatLine = self.formatLine + "; font-size:" + str(self.font_size) + "pt; font-weight:" + str(self.font_weight)
|
||||
self.formatLine = self.formatLine + "; color:" + self.font_color + ";\">$LINE</span></p></pre>"
|
||||
self.label_order = str(self.settings.get('label_order', '1723456'))
|
||||
self.cpuBool = int(self.settings.get('cpuBool', 1))
|
||||
self.cpuclockBool = int(self.settings.get('cpuclockBool', 1))
|
||||
|
@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>519</width>
|
||||
<height>383</height>
|
||||
<height>455</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@ -19,7 +19,7 @@
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>519</width>
|
||||
<height>383</height>
|
||||
<height>455</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
@ -43,13 +43,13 @@
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>511</width>
|
||||
<height>378</height>
|
||||
<height>450</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>378</height>
|
||||
<height>450</height>
|
||||
</size>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
@ -670,12 +670,12 @@
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>One device</string>
|
||||
<string notr="true">One device</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Two devices</string>
|
||||
<string notr="true">Two devices</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
@ -1274,7 +1274,101 @@
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_style">
|
||||
<widget class="QComboBox" name="comboBox_style">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>150</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>150</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">normal</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string notr="true">italic</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="widget_weight" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_weight">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">Font weight</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer07">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>19</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="spinBox_weight">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
@ -1296,6 +1390,18 @@
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>1000</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>50</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>400</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
@ -1314,6 +1420,7 @@
|
||||
<zorder>widget_net</zorder>
|
||||
<zorder>widget_bat</zorder>
|
||||
<zorder>widget_cpuclock</zorder>
|
||||
<zorder>widget_weight</zorder>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
@ -1367,7 +1474,8 @@
|
||||
<tabstop>fontComboBox</tabstop>
|
||||
<tabstop>spinBox_fontSize</tabstop>
|
||||
<tabstop>kcolorcombo</tabstop>
|
||||
<tabstop>lineEdit_style</tabstop>
|
||||
<tabstop>comboBox_style</tabstop>
|
||||
<tabstop>spinBox_weight</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
@ -9,7 +9,7 @@ X-Plasma-MainScript=code/main.py
|
||||
X-KDE-PluginInfo-Author=Evgeniy Alexeev aka arcanis
|
||||
X-KDE-PluginInfo-Email=esalexeev@gmail.com
|
||||
X-KDE-PluginInfo-Name=py-text-monitor
|
||||
X-KDE-PluginInfo-Version=1.1.2
|
||||
X-KDE-PluginInfo-Version=1.1.3
|
||||
X-KDE-PluginInfo-Website=http://kde-look.org/
|
||||
X-KDE-PluginInfo-Category=System Information
|
||||
X-KDE-PluginInfo-Depends=
|
||||
|
Loading…
Reference in New Issue
Block a user