Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mnogu/300341 to your computer and use it in GitHub Desktop.
Save mnogu/300341 to your computer and use it in GitHub Desktop.
Subject: [PATCH] Use the Oxygen style in the Qt4 toolbar
---
configure.ac | 13 +++++++++++--
qt4/toolbar/common-quimhelpertoolbar.cpp | 10 +++++-----
2 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/configure.ac b/configure.ac
index d2b0e2f..e2effba 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1257,8 +1257,8 @@ if test x$use_qt = xyes ; then
AC_SUBST(UIM_QT_LDFLAGS)
fi
-AC_PATH_PROGS(KDE_CONFIG, [kde-config kde4-config], [no])
-if test "x$use_qt" = "xyes" || test "x$use_qt4" = "xyes"; then
+AC_PATH_PROG(KDE_CONFIG, [kde-config], [no])
+if test "x$use_qt" = "xyes"; then
if test "x$KDE_CONFIG" != "xno"; then
KDE_ICONDIR=`$KDE_CONFIG --expandvars --install icon`
fi
@@ -1339,6 +1339,15 @@ if test "x$use_applet_kde4" = "xyes" && test "x$CMAKE" = "xno"; then
use_applet_kde4="no"
fi
AC_PATH_PROG(KDE4_CONFIG, [kde4-config], [no])
+if test "x$use_qt4" = "xyes"; then
+ if test "x$KDE4_CONFIG" != "xno"; then
+ KDE4_ICONDIR=`$KDE4_CONFIG --expandvars --install icon`
+ fi
+ if test -z "$KDE4_ICONDIR"; then
+ KDE4_ICONDIR="$prefix/share/icons"
+ fi
+ AC_DEFINE_UNQUOTED(KDE4_ICONDIR, "$KDE4_ICONDIR", [kde4 icon directory])
+fi
if test "x$use_applet_kde4" = "xyes" && test "x$KDE4_CONFIG" = "xno"; then
AC_MSG_WARN([no kde4-config found])
use_applet_kde4="no"
diff --git a/qt4/toolbar/common-quimhelpertoolbar.cpp b/qt4/toolbar/common-quimhelpertoolbar.cpp
index ddc8cb4..ea3e4cd 100644
--- a/qt4/toolbar/common-quimhelpertoolbar.cpp
+++ b/qt4/toolbar/common-quimhelpertoolbar.cpp
@@ -46,7 +46,7 @@
#include "qtgettext.h"
static const QString ICONDIR = UIM_PIXMAPSDIR;
-static const QString ACTION_ICONDIR = KDE_ICONDIR "/crystalsvg/16x16/actions";
+static const QString ACTION_ICONDIR = KDE4_ICONDIR "/oxygen/16x16/actions";
QUimHelperToolbar::QUimHelperToolbar( QWidget *parent, bool isApplet )
: QFrame( parent )
@@ -64,10 +64,10 @@ QUimHelperToolbar::QUimHelperToolbar( QWidget *parent, bool isApplet )
QPixmap swicon = QPixmap( ICONDIR + "/im_switcher.png" );
QPixmap preficon = QPixmap( ACTION_ICONDIR + "/configure.png");
QPixmap dicticon = QPixmap( ICONDIR + "/uim-dict.png");
- QPixmap padicon = QPixmap( ACTION_ICONDIR + "/text_bold.png");
- QPixmap handicon = QPixmap( ACTION_ICONDIR + "/edit.png");
- QPixmap helpicon = QPixmap( ACTION_ICONDIR + "/help.png");
- QPixmap exiticon = QPixmap( ACTION_ICONDIR + "/exit.png");
+ QPixmap padicon = QPixmap( ACTION_ICONDIR + "/format-text-bold.png");
+ QPixmap handicon = QPixmap( ACTION_ICONDIR + "/document-edit.png");
+ QPixmap helpicon = QPixmap( ACTION_ICONDIR + "/help-contents.png");
+ QPixmap exiticon = QPixmap( ACTION_ICONDIR + "/window-close.png");
QImage swimage = swicon.toImage();
QImage prefimage = preficon.toImage();
QImage dictimage = dicticon.toImage();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment