Work on ThemeFactory.

This commit is contained in:
Martin Rotter 2013-06-14 13:52:22 +02:00
parent c507c8a31c
commit fa2cebc811
3 changed files with 179 additions and 9 deletions

View File

@ -6,9 +6,6 @@
FormMain::FormMain(QWidget *parent) : QMainWindow(parent), m_ui(new Ui::FormMain) {
m_ui->setupUi(this);
// for testing purposes
m_ui->toolButton->setIcon(QIcon::fromTheme("application-exit"));
createConnections();
}

View File

@ -17,8 +17,8 @@
<widget class="QToolButton" name="toolButton">
<property name="geometry">
<rect>
<x>230</x>
<y>150</y>
<x>40</x>
<y>20</y>
<width>61</width>
<height>51</height>
</rect>
@ -26,6 +26,177 @@
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset theme="application-exit"/>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
</widget>
<widget class="QToolButton" name="toolButton_2">
<property name="geometry">
<rect>
<x>140</x>
<y>120</y>
<width>61</width>
<height>51</height>
</rect>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset theme="application-exit">
<normaloff/>
</iconset>
</property>
<property name="iconSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</widget>
<widget class="QToolButton" name="toolButton_3">
<property name="geometry">
<rect>
<x>240</x>
<y>30</y>
<width>61</width>
<height>51</height>
</rect>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset theme="application-exit">
<normaloff/>
</iconset>
</property>
<property name="iconSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
</widget>
<widget class="QToolButton" name="toolButton_4">
<property name="geometry">
<rect>
<x>40</x>
<y>200</y>
<width>171</width>
<height>141</height>
</rect>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset theme="application-exit">
<normaloff/>
</iconset>
</property>
<property name="iconSize">
<size>
<width>48</width>
<height>48</height>
</size>
</property>
</widget>
<widget class="QToolButton" name="toolButton_5">
<property name="geometry">
<rect>
<x>400</x>
<y>10</y>
<width>61</width>
<height>51</height>
</rect>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset theme="application-exit">
<normaloff/>
</iconset>
</property>
<property name="iconSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
</widget>
<widget class="QToolButton" name="toolButton_6">
<property name="geometry">
<rect>
<x>250</x>
<y>190</y>
<width>231</width>
<height>161</height>
</rect>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset theme="application-exit">
<normaloff/>
</iconset>
</property>
<property name="iconSize">
<size>
<width>96</width>
<height>96</height>
</size>
</property>
</widget>
<widget class="QToolButton" name="toolButton_7">
<property name="geometry">
<rect>
<x>520</x>
<y>160</y>
<width>161</width>
<height>151</height>
</rect>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset theme="application-exit">
<normaloff/>
</iconset>
</property>
<property name="iconSize">
<size>
<width>128</width>
<height>128</height>
</size>
</property>
</widget>
<widget class="QToolButton" name="toolButton_8">
<property name="geometry">
<rect>
<x>540</x>
<y>60</y>
<width>61</width>
<height>51</height>
</rect>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset theme="application-exit">
<normaloff/>
</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
@ -40,7 +211,7 @@
<x>0</x>
<y>0</y>
<width>800</width>
<height>19</height>
<height>21</height>
</rect>
</property>
<widget class="QMenu" name="m_menuFile">

View File

@ -18,14 +18,16 @@ void ThemeFactory::setupSearchPaths() {
}
// TODO: Load currently selected "real" icon theme name instead of
// Qt default "", which stands for currently active system icon theme name.
// Qt default "", which stands for currently active system icon theme name on
// linux. On Windows, tiny "oxygen" version will be added.
QString ThemeFactory::getSystemIconTheme() {
#if defined(Q_OS_LINUX)
// Empty string forces Qt to use icon theme from operating system.
return QString();
#else
// It is expected that oxygen is provided as fall-back theme for
// It is expected that mini-oxygen is provided as fall-back theme for
// windows edition of RSS Guard.
return "oxygen";
return "mini-oxygen";
#endif
}