summaryrefslogtreecommitdiffstats
path: root/tdestyles/plastik/config
diff options
context:
space:
mode:
Diffstat (limited to 'tdestyles/plastik/config')
-rw-r--r--tdestyles/plastik/config/CMakeLists.txt37
-rw-r--r--tdestyles/plastik/config/Makefile.am12
-rw-r--r--tdestyles/plastik/config/plastikconf.cpp223
-rw-r--r--tdestyles/plastik/config/plastikconf.h85
4 files changed, 357 insertions, 0 deletions
diff --git a/tdestyles/plastik/config/CMakeLists.txt b/tdestyles/plastik/config/CMakeLists.txt
new file mode 100644
index 000000000..531a65375
--- /dev/null
+++ b/tdestyles/plastik/config/CMakeLists.txt
@@ -0,0 +1,37 @@
+#################################################
+#
+# (C) 2010 Serghei Amelian
+# serghei (DOT) amelian (AT) gmail.com
+#
+# Improvements and feedback are welcome
+#
+# This file is released under GPL >= 2
+#
+#################################################
+
+include_directories(
+ ${TQT_INCLUDE_DIRS}
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}/tdecore
+ ${CMAKE_SOURCE_DIR}/tdecore
+ ${CMAKE_SOURCE_DIR}/tdeui
+)
+
+link_directories(
+ ${TQT_LIBRARY_DIRS}
+)
+
+
+##### tdestyle_plastik_config ######################
+
+set( target tdestyle_plastik_config )
+
+set( ${target}_SRCS
+ plastikconf.cpp
+)
+
+tde_add_kpart( ${target} AUTOMOC
+ SOURCES ${${target}_SRCS}
+ LINK tdeui-shared
+ DESTINATION ${PLUGIN_INSTALL_DIR}
+)
diff --git a/tdestyles/plastik/config/Makefile.am b/tdestyles/plastik/config/Makefile.am
new file mode 100644
index 000000000..428baf69f
--- /dev/null
+++ b/tdestyles/plastik/config/Makefile.am
@@ -0,0 +1,12 @@
+INCLUDES = $(all_includes)
+
+noinst_HEADERS = plastikconf.h
+kde_module_LTLIBRARIES = tdestyle_plastik_config.la
+tdestyle_plastik_config_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
+tdestyle_plastik_config_la_LIBADD = $(LIB_TDEUI) $(LIB_QT) $(LIB_TDECORE)
+tdestyle_plastik_config_la_SOURCES = plastikconf.cpp
+tdestyle_plastik_config_la_METASOURCES = AUTO
+
+
+messages:
+ $(XGETTEXT) *.cpp *.h -o $(podir)/tdestyle_plastik_config.pot
diff --git a/tdestyles/plastik/config/plastikconf.cpp b/tdestyles/plastik/config/plastikconf.cpp
new file mode 100644
index 000000000..4900f708e
--- /dev/null
+++ b/tdestyles/plastik/config/plastikconf.cpp
@@ -0,0 +1,223 @@
+/*
+Copyright (C) 2003 Sandro Giessl <ceebx@users.sourceforge.net>
+
+based on the Keramik configuration dialog:
+Copyright (c) 2003 Maksim Orlovich <maksim.orlovich@kdemail.net>
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+
+*/
+
+#include <tqcheckbox.h>
+#include <tqlayout.h>
+#include <tqhbox.h>
+#include <tqsettings.h>
+#include <tqcolor.h>
+#include <tqgroupbox.h>
+#include <tdeglobal.h>
+#include <tdelocale.h>
+#include <kcolorbutton.h>
+#include <kdemacros.h>
+
+#include "plastikconf.h"
+
+extern "C"
+{
+ KDE_EXPORT TQWidget* allocate_tdestyle_config(TQWidget* parent)
+ {
+ TDEGlobal::locale()->insertCatalogue("tdestyle_plastik_config");
+ return new PlastikStyleConfig(parent);
+ }
+}
+
+PlastikStyleConfig::PlastikStyleConfig(TQWidget* parent): TQWidget(parent)
+{
+ //Should have no margins here, the dialog provides them
+ TQVBoxLayout* layout = new TQVBoxLayout(this, 0, 0);
+ TDEGlobal::locale()->insertCatalogue("tdestyle_plastik_config");
+
+// scrollBarLines = new TQCheckBox(i18n("Scrollbar handle lines"), this);
+ animateProgressBar = new TQCheckBox(i18n("Animate progress bars"), this);
+ drawToolBarSeparator = new TQCheckBox(i18n("Draw toolbar separator"), this);
+ drawToolBarItemSeparator = new TQCheckBox(i18n("Draw toolbar item separators"), this);
+// drawFocusRect = new TQCheckBox(i18n("Draw focus rectangles"), this);
+ drawTriangularExpander = new TQCheckBox(i18n("Triangular tree expander"), this);
+ inputFocusHighlight = new TQCheckBox(i18n("Highlight focused text input fields"), this);
+
+ customFocusHighlightColor = new TQCheckBox(i18n("Custom text input highlight color:"), this);
+ TQHBox *hbox1 = new TQHBox(this);
+ hbox1->layout()->addItem(new TQSpacerItem(20, 0, TQSizePolicy::Fixed, TQSizePolicy::Minimum) );
+ focusHighlightColor = new KColorButton(hbox1);
+
+ customOverHighlightColor = new TQCheckBox(i18n("Custom mouseover highlight color:"), this);
+ TQHBox *hbox2 = new TQHBox(this);
+ hbox2->layout()->addItem(new TQSpacerItem(20, 0, TQSizePolicy::Fixed, TQSizePolicy::Minimum) );
+ overHighlightColor = new KColorButton(hbox2);
+
+ customCheckMarkColor = new TQCheckBox(i18n("Custom checkmark color:"), this);
+ TQHBox *hbox3 = new TQHBox(this);
+ hbox3->layout()->addItem(new TQSpacerItem(20, 0, TQSizePolicy::Fixed, TQSizePolicy::Minimum) );
+ checkMarkColor = new KColorButton(hbox3);
+
+// layout->add(scrollBarLines);
+ layout->add(animateProgressBar);
+ layout->add(drawToolBarSeparator);
+ layout->add(drawToolBarItemSeparator);
+// layout->add(drawFocusRect);
+ layout->add(drawTriangularExpander);
+ layout->add(inputFocusHighlight);
+ layout->add(customFocusHighlightColor);
+ layout->add(hbox1);
+ layout->add(customOverHighlightColor);
+ layout->add(hbox2);
+ layout->add(customCheckMarkColor);
+ layout->add(hbox3);
+ layout->addStretch(1);
+
+ TQSettings s;
+// origScrollBarLines = s.readBoolEntry("/plastikstyle/Settings/scrollBarLines", false);
+// scrollBarLines->setChecked(origScrollBarLines);
+ origAnimProgressBar = s.readBoolEntry("/plastikstyle/Settings/animateProgressBar", false);
+ animateProgressBar->setChecked(origAnimProgressBar);
+ origDrawToolBarSeparator = s.readBoolEntry("/plastikstyle/Settings/drawToolBarSeparator", false);
+ drawToolBarSeparator->setChecked(origDrawToolBarSeparator);
+ origDrawToolBarItemSeparator = s.readBoolEntry("/plastikstyle/Settings/drawToolBarItemSeparator", true);
+ drawToolBarItemSeparator->setChecked(origDrawToolBarItemSeparator);
+// origDrawFocusRect = s.readBoolEntry("/plastikstyle/Settings/drawFocusRect", true);
+// drawFocusRect->setChecked(origDrawFocusRect);
+ origDrawTriangularExpander = s.readBoolEntry("/plastikstyle/Settings/drawTriangularExpander", false);
+ drawTriangularExpander->setChecked(origDrawTriangularExpander);
+ origInputFocusHighlight = s.readBoolEntry("/plastikstyle/Settings/inputFocusHighlight", true);
+ inputFocusHighlight->setChecked(origInputFocusHighlight);
+ origCustomOverHighlightColor = s.readBoolEntry("/plastikstyle/Settings/customOverHighlightColor", false);
+ customOverHighlightColor->setChecked(origCustomOverHighlightColor);
+ origOverHighlightColor = s.readEntry("/plastikstyle/Settings/overHighlightColor", "black");
+ overHighlightColor->setColor(origOverHighlightColor);
+ origCustomFocusHighlightColor = s.readBoolEntry("/plastikstyle/Settings/customFocusHighlightColor", false);
+ customFocusHighlightColor->setChecked(origCustomFocusHighlightColor);
+ origFocusHighlightColor = s.readEntry("/plastikstyle/Settings/focusHighlightColor", "black");
+ focusHighlightColor->setColor(origFocusHighlightColor);
+ origCustomCheckMarkColor = s.readBoolEntry("/plastikstyle/Settings/customCheckMarkColor", false);
+ customCheckMarkColor->setChecked(origCustomCheckMarkColor);
+ origCheckMarkColor = s.readEntry("/plastikstyle/Settings/checkMarkColor", "black");
+ checkMarkColor->setColor(origCheckMarkColor);
+
+// connect(scrollBarLines, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) );
+ connect(animateProgressBar, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) );
+ connect(drawToolBarSeparator, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) );
+ connect(drawToolBarItemSeparator, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) );
+// connect(drawFocusRect, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) );
+ connect(drawTriangularExpander, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) );
+ connect(inputFocusHighlight, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) );
+ connect(customOverHighlightColor, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) );
+ connect(overHighlightColor, TQT_SIGNAL( changed(const TQColor&) ), TQT_SLOT( updateChanged() ) );
+ connect(customFocusHighlightColor, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) );
+ connect(focusHighlightColor, TQT_SIGNAL( changed(const TQColor&) ), TQT_SLOT( updateChanged() ) );
+ connect(customCheckMarkColor, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) );
+ connect(checkMarkColor, TQT_SIGNAL( changed(const TQColor&) ), TQT_SLOT( updateChanged() ) );
+ if ( customOverHighlightColor->isChecked() )
+ overHighlightColor->setEnabled(true);
+ else
+ overHighlightColor->setEnabled(false);
+ if ( customFocusHighlightColor->isChecked() )
+ focusHighlightColor->setEnabled(true);
+ else
+ focusHighlightColor->setEnabled(false);
+ if ( customCheckMarkColor->isChecked() )
+ checkMarkColor->setEnabled(true);
+ else
+ checkMarkColor->setEnabled(false);
+}
+
+PlastikStyleConfig::~PlastikStyleConfig()
+{
+}
+
+
+void PlastikStyleConfig::save()
+{
+ TQSettings s;
+// s.writeEntry("/plastikstyle/Settings/scrollBarLines", scrollBarLines->isChecked());
+ s.writeEntry("/plastikstyle/Settings/animateProgressBar", animateProgressBar->isChecked());
+ s.writeEntry("/plastikstyle/Settings/drawToolBarSeparator", drawToolBarSeparator->isChecked());
+ s.writeEntry("/plastikstyle/Settings/drawToolBarItemSeparator", drawToolBarItemSeparator->isChecked());
+// s.writeEntry("/plastikstyle/Settings/drawFocusRect", drawFocusRect->isChecked());
+ s.writeEntry("/plastikstyle/Settings/drawTriangularExpander", drawTriangularExpander->isChecked());
+ s.writeEntry("/plastikstyle/Settings/inputFocusHighlight", inputFocusHighlight->isChecked());
+ s.writeEntry("/plastikstyle/Settings/customOverHighlightColor", customOverHighlightColor->isChecked());
+ s.writeEntry("/plastikstyle/Settings/overHighlightColor", TQColor(overHighlightColor->color()).name());
+ s.writeEntry("/plastikstyle/Settings/customFocusHighlightColor", customFocusHighlightColor->isChecked());
+ s.writeEntry("/plastikstyle/Settings/focusHighlightColor", TQColor(focusHighlightColor->color()).name());
+ s.writeEntry("/plastikstyle/Settings/customCheckMarkColor", customCheckMarkColor->isChecked());
+ s.writeEntry("/plastikstyle/Settings/checkMarkColor", TQColor(checkMarkColor->color()).name());
+}
+
+void PlastikStyleConfig::defaults()
+{
+// scrollBarLines->setChecked(false);
+ animateProgressBar->setChecked(false);
+ drawToolBarSeparator->setChecked(false);
+ drawToolBarItemSeparator->setChecked(true);
+// drawFocusRect->setChecked(true);
+ drawTriangularExpander->setChecked(false);
+ inputFocusHighlight->setChecked(true);
+ customOverHighlightColor->setChecked(false);
+ overHighlightColor->setColor("black");
+ customFocusHighlightColor->setChecked(false);
+ focusHighlightColor->setColor("black");
+ customCheckMarkColor->setChecked(false);
+ checkMarkColor->setColor("black");
+ //updateChanged would be done by setChecked already
+}
+
+void PlastikStyleConfig::updateChanged()
+{
+ if ( customOverHighlightColor->isChecked() )
+ overHighlightColor->setEnabled(true);
+ else
+ overHighlightColor->setEnabled(false);
+ if ( customFocusHighlightColor->isChecked() )
+ focusHighlightColor->setEnabled(true);
+ else
+ focusHighlightColor->setEnabled(false);
+ if ( customCheckMarkColor->isChecked() )
+ checkMarkColor->setEnabled(true);
+ else
+ checkMarkColor->setEnabled(false);
+
+ if (/*(scrollBarLines->isChecked() == origScrollBarLines) &&*/
+ (animateProgressBar->isChecked() == origAnimProgressBar) &&
+ (drawToolBarSeparator->isChecked() == origDrawToolBarSeparator) &&
+ (drawToolBarItemSeparator->isChecked() == origDrawToolBarItemSeparator) &&
+// (drawFocusRect->isChecked() == origDrawFocusRect) &&
+ (drawTriangularExpander->isChecked() == origDrawTriangularExpander) &&
+ (inputFocusHighlight->isChecked() == origInputFocusHighlight) &&
+ (customOverHighlightColor->isChecked() == origCustomOverHighlightColor) &&
+ (overHighlightColor->color() == origOverHighlightColor) &&
+ (customFocusHighlightColor->isChecked() == origCustomFocusHighlightColor) &&
+ (focusHighlightColor->color() == origFocusHighlightColor) &&
+ (customCheckMarkColor->isChecked() == origCustomCheckMarkColor) &&
+ (checkMarkColor->color() == origCheckMarkColor)
+ )
+ emit changed(false);
+ else
+ emit changed(true);
+}
+
+#include "plastikconf.moc"
diff --git a/tdestyles/plastik/config/plastikconf.h b/tdestyles/plastik/config/plastikconf.h
new file mode 100644
index 000000000..512ad6f2e
--- /dev/null
+++ b/tdestyles/plastik/config/plastikconf.h
@@ -0,0 +1,85 @@
+/*
+Copyright (C) 2003 Sandro Giessl <ceebx@users.sourceforge.net>
+
+based on the Keramik configuration dialog:
+Copyright (c) 2003 Maksim Orlovich <maksim.orlovich@kdemail.net>
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+
+*/
+
+#ifndef PLASTIK_CONF_H
+#define PLASTIK_CONF_H
+
+class TQCheckBox;
+
+class PlastikStyleConfig: public TQWidget
+{
+ Q_OBJECT
+public:
+ PlastikStyleConfig(TQWidget* parent);
+ ~PlastikStyleConfig();
+
+ //This signal and the next two slots are the plugin
+ //page interface
+signals:
+ void changed(bool);
+
+public slots:
+ void save();
+ void defaults();
+
+ //Everything below this is internal.
+protected slots:
+ void updateChanged();
+
+protected:
+ //We store settings directly in widgets to
+ //avoid the hassle of sync'ing things
+// TQCheckBox* scrollBarLines;
+ TQCheckBox* animateProgressBar;
+ TQCheckBox* drawToolBarSeparator;
+ TQCheckBox* drawToolBarItemSeparator;
+// TQCheckBox* drawFocusRect;
+ TQCheckBox* drawTriangularExpander;
+ TQCheckBox* inputFocusHighlight;
+ TQCheckBox* customOverHighlightColor;
+ KColorButton* overHighlightColor;
+ TQCheckBox* customFocusHighlightColor;
+ KColorButton* focusHighlightColor;
+ TQCheckBox* customCheckMarkColor;
+ KColorButton* checkMarkColor;
+
+ //Original settings, for accurate dirtiness tracking
+// bool origScrollBarLines;
+ bool origAnimProgressBar;
+ bool origDrawToolBarSeparator;
+ bool origDrawToolBarItemSeparator;
+// bool origDrawFocusRect;
+ bool origDrawTriangularExpander;
+ bool origInputFocusHighlight;
+ bool origCustomOverHighlightColor;
+ TQColor origOverHighlightColor;
+ bool origCustomFocusHighlightColor;
+ TQColor origFocusHighlightColor;
+ bool origCustomCheckMarkColor;
+ TQColor origCheckMarkColor;
+};
+
+#endif