summaryrefslogtreecommitdiffstats
path: root/styles/phase2/config/phase2styleconfig.cpp
diff options
context:
space:
mode:
authorVincent Reher <tde@4reher.org>2021-01-21 12:51:58 -0800
committerVincent Reher <tde@4reher.org>2021-01-21 12:51:58 -0800
commit714ac1f0c4ca9bcb352aa90ab11c0bd294b20c2f (patch)
tree52972183cfadca52c1ef2185fb21741e81ab0290 /styles/phase2/config/phase2styleconfig.cpp
parentf39f559fbfecb22bdfd46b07ba87ab832af2ae27 (diff)
downloadtdeartwork-feature/Phase2_style.tar.gz
tdeartwork-feature/Phase2_style.zip
Introduce new TDE widget style that scales with font DPI.feature/Phase2_style
Style is based on the 'phase' style which according to its author David Johnson, is "abandonware" (per 2020-09-24 email to Author). This initial commit is based on code developed <= 2020-07-20 and has been tested and actively used on Author's systems to date. Signed-off-by: Vincent Reher <tde@4reher.org>
Diffstat (limited to 'styles/phase2/config/phase2styleconfig.cpp')
-rw-r--r--styles/phase2/config/phase2styleconfig.cpp111
1 files changed, 111 insertions, 0 deletions
diff --git a/styles/phase2/config/phase2styleconfig.cpp b/styles/phase2/config/phase2styleconfig.cpp
new file mode 100644
index 00000000..4528f47a
--- /dev/null
+++ b/styles/phase2/config/phase2styleconfig.cpp
@@ -0,0 +1,111 @@
+//////////////////////////////////////////////////////////////////////////////
+// phasestyleconfig.cpp
+// -------------------
+// Config dialog for Phase widget style
+// -------------------
+// Copyright (c) 2004 David Johnson <david@usermode.org>
+// Please see the header file for copyright and license information.
+//////////////////////////////////////////////////////////////////////////////
+
+#include <tqsettings.h>
+#include <tqcheckbox.h>
+#include <tqgroupbox.h>
+#include <tqwhatsthis.h>
+#include <tdelocale.h>
+#include <tdeglobal.h>
+
+#include "phase2styleconfig.h"
+#include "styledialog.h"
+
+//////////////////////////////////////////////////////////////////////////////
+// PhaseStyleConfig Class //
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+// PhaseStyleConfig()
+// ----------------
+// Constructor
+
+PhaseStyleConfig::PhaseStyleConfig(TQWidget* parent) : StyleDialog(parent)
+{
+ TDEGlobal::locale()->insertCatalogue("tdestyle_phase_config");
+
+ TQSettings settings;
+ oldgradients =
+ settings.readBoolEntry("/phasestyle/Settings/gradients", true);
+ gradients->setChecked(oldgradients);
+ oldhighlights =
+ settings.readBoolEntry("/phasestyle/Settings/highlights", true);
+ highlights->setChecked(oldhighlights);
+
+ // connections
+ connect(gradients, TQT_SIGNAL(toggled(bool)),
+ this, TQT_SLOT(updateChanged()));
+ connect(highlights, TQT_SIGNAL(toggled(bool)),
+ this, TQT_SLOT(updateChanged()));
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// ~PhaseStyleConfig()
+// -----------------
+// Destructor
+
+PhaseStyleConfig::~PhaseStyleConfig()
+{
+ TDEGlobal::locale()->removeCatalogue("tdestyle_phase_config");
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// selectionChanged()
+// ------------------
+// Selection has changed
+
+void PhaseStyleConfig::updateChanged()
+{
+ bool update = false;
+
+ if ((gradients->isChecked() != oldgradients) ||
+ (highlights->isChecked() != oldhighlights)) {
+ update = true;
+ }
+
+ emit changed(update);
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// save()
+// ------
+// Save the settings
+
+void PhaseStyleConfig::save()
+{
+ TQSettings settings;
+ settings.writeEntry("/phasestyle/Settings/gradients",
+ gradients->isChecked());
+ settings.writeEntry("/phasestyle/Settings/highlights",
+ highlights->isChecked());
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// defaults()
+// ----------
+// Set to the defaults
+
+void PhaseStyleConfig::defaults()
+{
+ gradients->setChecked(true);
+ highlights->setChecked(true);
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// Plugin Stuff //
+//////////////////////////////////////////////////////////////////////////////
+
+extern "C"
+{
+ KDE_EXPORT TQObject* allocate_tdestyle_config(TQWidget* parent) {
+ return(TQT_TQOBJECT(new PhaseStyleConfig(parent)));
+ }
+}
+
+#include "phase2styleconfig.moc"