diff options
Diffstat (limited to 'src/gui/kernel/qkde.cpp')
-rw-r--r-- | src/gui/kernel/qkde.cpp | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/src/gui/kernel/qkde.cpp b/src/gui/kernel/qkde.cpp index 6c8909f..edc53ac 100644 --- a/src/gui/kernel/qkde.cpp +++ b/src/gui/kernel/qkde.cpp @@ -141,14 +141,33 @@ QString QKde::kdeStyle() return QLatin1String("windows"); } -/*!\internal - placeholder to load icon from kde. - to be implemented - */ -QIcon QKde::kdeIcon(const QString &name) + +int QKde::kdeToolButtonStyle() +{ + QSettings settings(QKde::kdeHome() + QLatin1String("/share/config/kdeglobals"), + QSettings::IniFormat); + settings.beginGroup(QLatin1String("Toolbar style")); + QString toolbarStyle = settings.value(QLatin1String("ToolButtonStyle"), QLatin1String("TextBesideIcon")).toString(); + if (toolbarStyle == QLatin1String("TextBesideIcon")) + return Qt::ToolButtonTextBesideIcon; + else if (toolbarStyle == QLatin1String("TextOnly")) + return Qt::ToolButtonTextOnly; + else if (toolbarStyle == QLatin1String("TextUnderIcon")) + return Qt::ToolButtonTextUnderIcon; + + return Qt::ToolButtonTextBesideIcon; +} + +int QKde::kdeToolBarIconSize() { - //###todo - return QIcon(); + static int iconSize = -1; + if (iconSize == -1) { + QSettings settings(QKde::kdeHome() + QLatin1String("/share/config/kdeglobals"), + QSettings::IniFormat); + settings.beginGroup(QLatin1String("ToolbarIcons")); + iconSize = settings.value(QLatin1String("Size")).toInt(); + } + return iconSize; } QT_END_NAMESPACE |