diff --git a/kwin/kcmkwin/kwindecoration/CMakeLists.txt b/kwin/kcmkwin/kwindecoration/CMakeLists.txt index fc285ab3..ee32b4ed 100644 --- a/kwin/kcmkwin/kwindecoration/CMakeLists.txt +++ b/kwin/kcmkwin/kwindecoration/CMakeLists.txt @@ -63,4 +63,4 @@ install( buttons/shade.png buttons/spacer.png DESTINATION ${KDE4_DATA_INSTALL_DIR}/kwin/kcm_kwindecoration/buttons -) \ No newline at end of file +) diff --git a/kwin/kcmkwin/kwinoptions/CMakeLists.txt b/kwin/kcmkwin/kwinoptions/CMakeLists.txt index 266a2035..c4a1bee0 100644 --- a/kwin/kcmkwin/kwinoptions/CMakeLists.txt +++ b/kwin/kcmkwin/kwinoptions/CMakeLists.txt @@ -12,14 +12,30 @@ set(kcm_kwinoptions_PART_SRCS ) kde4_add_plugin(kcm_kwinoptions ${kcm_kwinoptions_PART_SRCS}) -target_link_libraries(kcm_kwinoptions ${KDE4_KDEUI_LIBS}) -install(TARGETS kcm_kwinoptions DESTINATION ${KDE4_PLUGIN_INSTALL_DIR} ) +target_link_libraries(kcm_kwinoptions ${KDE4_KDEUI_LIBS}) +install( + TARGETS kcm_kwinoptions + DESTINATION ${KDE4_PLUGIN_INSTALL_DIR} +) ########### install files ############### -install( FILES kwinoptions.desktop kwinactions.desktop kwinadvanced.desktop +install( + FILES + kwinoptions.desktop + kwinactions.desktop + kwinadvanced.desktop kwinfocus.desktop kwinmoving.desktop - DESTINATION ${KDE4_SERVICES_INSTALL_DIR}) + DESTINATION ${KDE4_SERVICES_INSTALL_DIR} +) -kde4_install_icons( ${KDE4_ICON_INSTALL_DIR} ) +install( + FILES + buttons/max1.png + buttons/max2.png + buttons/max3.png + DESTINATION ${KDE4_DATA_INSTALL_DIR}/kwin/kcm_kwinoptions/buttons +) + +kde4_install_icons(${KDE4_ICON_INSTALL_DIR}) diff --git a/kwin/kcmkwin/kwinoptions/buttons/max1.png b/kwin/kcmkwin/kwinoptions/buttons/max1.png new file mode 100644 index 00000000..0135a7ee Binary files /dev/null and b/kwin/kcmkwin/kwinoptions/buttons/max1.png differ diff --git a/kwin/kcmkwin/kwinoptions/buttons/max2.png b/kwin/kcmkwin/kwinoptions/buttons/max2.png new file mode 100644 index 00000000..802e7a48 Binary files /dev/null and b/kwin/kcmkwin/kwinoptions/buttons/max2.png differ diff --git a/kwin/kcmkwin/kwinoptions/buttons/max3.png b/kwin/kcmkwin/kwinoptions/buttons/max3.png new file mode 100644 index 00000000..2753d327 Binary files /dev/null and b/kwin/kcmkwin/kwinoptions/buttons/max3.png differ diff --git a/kwin/kcmkwin/kwinoptions/mouse.cpp b/kwin/kcmkwin/kwinoptions/mouse.cpp index 0ccbe1fc..443e392b 100644 --- a/kwin/kcmkwin/kwinoptions/mouse.cpp +++ b/kwin/kcmkwin/kwinoptions/mouse.cpp @@ -20,25 +20,25 @@ #include "mouse.h" #include -#include - #include #include #include - #include #include #include #include #include +#include #include #include #include #include +#include #include +#include #include -#include +#include #include #include @@ -68,64 +68,25 @@ QPixmap maxButtonPixmaps[3]; void createMaxButtonPixmaps() { - char const * maxButtonXpms[][3 + 13] = { - { - 0, 0, 0, - "...............", - ".......#.......", - "......###......", - ".....#####.....", - "..#....#....#..", - ".##....#....##.", - "###############", - ".##....#....##.", - "..#....#....#..", - ".....#####.....", - "......###......", - ".......#.......", - "..............." - }, - { - 0, 0, 0, - "...............", - ".......#.......", - "......###......", - ".....#####.....", - ".......#.......", - ".......#.......", - ".......#.......", - ".......#.......", - ".......#.......", - ".....#####.....", - "......###......", - ".......#.......", - "..............." - }, - { - 0, 0, 0, - "...............", - "...............", - "...............", - "...............", - "..#.........#..", - ".##.........##.", - "###############", - ".##.........##.", - "..#.........#..", - "...............", - "...............", - "...............", - "..............." - }, + static const char* imagefilepaths[] = { + "kwin/kcm_kwinoptions/buttons/max1.png", + "kwin/kcm_kwinoptions/buttons/max2.png", + "kwin/kcm_kwinoptions/buttons/max3.png", }; - - QByteArray baseColor(". c " + KColorScheme(QPalette::Active, KColorScheme::View).background().color().name().toAscii()); - QByteArray textColor("# c " + KColorScheme(QPalette::Active, KColorScheme::View).foreground().color().name().toAscii()); for (int t = 0; t < 3; ++t) { - maxButtonXpms[t][0] = "15 13 2 1"; - maxButtonXpms[t][1] = baseColor.constData(); - maxButtonXpms[t][2] = textColor.constData(); - maxButtonPixmaps[t] = QPixmap(maxButtonXpms[t]); + const QString imagefilepath = KGlobal::dirs()->findResource("data", imagefilepaths[t]); + if (imagefilepath.isEmpty()) { + kWarning() << "No button image for" << imagefilepaths[t]; + continue; + } + QImage image(imagefilepath); + KIconEffect::toMonochrome( + image, + KColorScheme(QPalette::Active, KColorScheme::View).foreground().color(), + KColorScheme(QPalette::Active, KColorScheme::View).background().color(), + float(1.0) + ); + maxButtonPixmaps[t] = QPixmap::fromImage(image); maxButtonPixmaps[t].setMask(maxButtonPixmaps[t].createHeuristicMask()); } }