summaryrefslogtreecommitdiffstats
path: root/style/optionHandler.cpp
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2016-03-25 20:03:28 +0100
committerSlávek Banko <slavek.banko@axis.cz>2016-03-25 20:03:28 +0100
commit2ee99ab520931c5efe91123c85ba10064a45e95d (patch)
treea367666e410de28d0f258aed77b11e17cafb28e4 /style/optionHandler.cpp
parentcfa36e1a95e82492c17225ff376911abb3688f62 (diff)
downloadtde-style-baghira-2ee99ab520931c5efe91123c85ba10064a45e95d.tar.gz
tde-style-baghira-2ee99ab520931c5efe91123c85ba10064a45e95d.zip
Initial TQt conversion
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'style/optionHandler.cpp')
-rw-r--r--style/optionHandler.cpp100
1 files changed, 50 insertions, 50 deletions
diff --git a/style/optionHandler.cpp b/style/optionHandler.cpp
index d96b700..2ab110a 100644
--- a/style/optionHandler.cpp
+++ b/style/optionHandler.cpp
@@ -1,17 +1,17 @@
#include "baghira.h"
-#include <qapplication.h>
-#include <qbrush.h>
-#include <qcolor.h>
-#include <qevent.h>
-#include <qimage.h>
-#include <qobject.h>
-#include <qpainter.h>
-#include <qpalette.h>
-#include <qpopupmenu.h>
-#include <qrect.h>
-#include <qsettings.h>
-#include <qsize.h>
-#include <qstring.h>
+#include <tqapplication.h>
+#include <tqbrush.h>
+#include <tqcolor.h>
+#include <tqevent.h>
+#include <tqimage.h>
+#include <tqobject.h>
+#include <tqpainter.h>
+#include <tqpalette.h>
+#include <tqpopupmenu.h>
+#include <tqrect.h>
+#include <tqsettings.h>
+#include <tqsize.h>
+#include <tqstring.h>
// #include <kconfig.h>
#include <kpixmapeffect.h>
#include <stdio.h>
@@ -24,42 +24,42 @@
x > u ? u :\
x
-OptionHandler::OptionHandler( QObject *parent ) : QObject( parent ) {
+OptionHandler::OptionHandler( TQObject *parent ) : TQObject( parent ) {
scrollerActive = false;
groupShadowButton = false;
reloadSettings();
}
-const QColor& OptionHandler::textColor() {
- return ( useCustomMenuColor ? fgColor : qApp->palette().active().text() );
+const TQColor& OptionHandler::textColor() {
+ return ( useCustomMenuColor ? fgColor : tqApp->palette().active().text() );
}
-const QColor& OptionHandler::bgColor() {
- return qApp->palette().active().background();
+const TQColor& OptionHandler::bgColor() {
+ return tqApp->palette().active().background();
}
-const QColor& OptionHandler::buttonColor() {
+const TQColor& OptionHandler::buttonColor() {
LiquidStyle * style = ( LiquidStyle* ) parent();
/*if (style->isKicker) return style->origPanelBrush.color();
else */if (style->isOOO) return CustomButtonColor();
- else return qApp->palette().active().button();
+ else return tqApp->palette().active().button();
}
void OptionHandler::reloadSettings() {
// gather options...
- QSettings config;
+ TQSettings config;
config.beginGroup("/baghira/Style");
//we need that first to make sure we use some proper settings ;)
- customButtonColor = QColor(config.readNumEntry("Design_ButtonColor",(int)qApp->palette().active().button().rgb()));
+ customButtonColor = TQColor(config.readNumEntry("Design_ButtonColor",(int)tqApp->palette().active().button().rgb()));
// design handling:
// first try file:
- QString tmpString;
+ TQString tmpString;
FILE *file = NULL;
wmDesign = 5;
for (int i = 0; i < 8; i++)
custCols[i] = -1;
- if (qstrcmp( qApp->argv() [ 0 ], "ksplash" ) == 0)
+ if (qstrcmp( tqApp->argv() [ 0 ], "ksplash" ) == 0)
{
style_ = Panther;
_toolbuttonStyle = Panther;
@@ -72,17 +72,17 @@ void OptionHandler::reloadSettings() {
{
// first try for a tmp file from bab starter
int tmpFile = 0;
- tmpString = QDir::homeDirPath() + "/.baghira/.bab/" + qApp->argv() [ 0 ];
+ tmpString = TQDir::homeDirPath() + "/.baghira/.bab/" + tqApp->argv() [ 0 ];
file = fopen(tmpString.latin1(), "r");
if( file == NULL )
{
tmpFile = 1;
- tmpString = QDir::homeDirPath() + "/.baghira/" + qApp->argv() [ 0 ];
+ tmpString = TQDir::homeDirPath() + "/.baghira/" + tqApp->argv() [ 0 ];
file = fopen(tmpString.latin1(), "r");
if( file == NULL )
{
tmpFile = 2;
- tmpString = QDir::homeDirPath() + "/.baghira/.bab/.style";
+ tmpString = TQDir::homeDirPath() + "/.baghira/.bab/.style";
file = fopen(tmpString.latin1(), "r");
}
}
@@ -110,7 +110,7 @@ void OptionHandler::reloadSettings() {
remove(tmpString.latin1()); // remove TEMPORARY file
else if (tmpFile == 2)
{
- tmpString = QDir::homeDirPath() + "/.baghira/.bab/.deco";
+ tmpString = TQDir::homeDirPath() + "/.baghira/.bab/.deco";
if ((file = fopen(tmpString.latin1(), "r")) != NULL)
{
fscanf(file,"%u\n%u\n",&i3, &wmDesign);
@@ -148,23 +148,23 @@ void OptionHandler::reloadSettings() {
useCustomMenuColor = (menuColorStyle == 2);
shadowText = config.readBoolEntry( "Menu_ShadowText", false);
if (useCustomMenuColor){
- color = QColor( config.readNumEntry( "Menu_Color1", 0 ) );
- color2 = QColor( config.readNumEntry( "Menu_Color2", 0 ) );
- colorHigh = QColor( config.readNumEntry( "Menu_ColorHighlight", 0 ) );
- fgColor = QColor( config.readNumEntry( "Menu_TextColor", 0 ) );
- fgColorHigh = QColor( config.readNumEntry( "Menu_TextColorHighlight", 0 ) );
+ color = TQColor( config.readNumEntry( "Menu_Color1", 0 ) );
+ color2 = TQColor( config.readNumEntry( "Menu_Color2", 0 ) );
+ colorHigh = TQColor( config.readNumEntry( "Menu_ColorHighlight", 0 ) );
+ fgColor = TQColor( config.readNumEntry( "Menu_TextColor", 0 ) );
+ fgColorHigh = TQColor( config.readNumEntry( "Menu_TextColorHighlight", 0 ) );
}
else if (menuColorButton){
color = customButtonColor;
color2 = customButtonColor.dark(130);
}
else {
- color = qApp->palette().active().background();
- color2 = qApp->palette().active().background().dark(130);
+ color = tqApp->palette().active().background();
+ color2 = tqApp->palette().active().background().dark(130);
}
drawMenuStripe_ = config.readBoolEntry("Menu_DrawMenuStripe", false);
if (drawMenuStripe_)
- menuStripeColor_ = QColor(config.readNumEntry("Menu_StripeColor"),(int)Qt::white.rgb());
+ menuStripeColor_ = TQColor(config.readNumEntry("Menu_StripeColor"),(int)TQt::white.rgb());
// color stuff
// widgets
customWidgetColor = config.readBoolEntry( "Colors_UseCustomColors", false);
@@ -181,7 +181,7 @@ void OptionHandler::reloadSettings() {
customColors[ CustomSBGroove ].setRgb( config.readNumEntry( "Colors_SliderGroove", ( int ) bgColor().rgb() ) );
}
if (inactiveButtonColor == Custom)
- customInactiveButtonColor = QColor( config.readNumEntry( "Design_InactiveButtonColor", (int) bgColor().rgb()));
+ customInactiveButtonColor = TQColor( config.readNumEntry( "Design_InactiveButtonColor", (int) bgColor().rgb()));
contrast += config.readNumEntry( "Design_StippleContrast", 3);
bevelHighlights_ = config.readBoolEntry( "Design_BevelAsHighlight", true);
//shadows
@@ -191,11 +191,11 @@ groupboxshadow = (style_ == Brushed) ? false : config.readBoolEntry( "Design_Sha
expanderStyle = config.readNumEntry( "Special_ExpanderStyle", Apple);
useCustomExpanderColor = config.readBoolEntry( "Special_CustomExpanderColor", false);
if (useCustomExpanderColor)
- expanderColor = QColor( config.readNumEntry( "Special_ExpanderColor", (int) qApp->palette().active().text().rgb()));
+ expanderColor = TQColor( config.readNumEntry( "Special_ExpanderColor", (int) tqApp->palette().active().text().rgb()));
drawDotlines = config.readBoolEntry( "Special_DrawTreeLines", true);
if (drawDotlines){
dotlineStyle = config.readNumEntry( "Special_TreelineStyle", Line);
- dotlineColor = QColor( config.readNumEntry( "Special_TreelineColor", (int) qApp->palette().active().mid().rgb()));
+ dotlineColor = TQColor( config.readNumEntry( "Special_TreelineColor", (int) tqApp->palette().active().mid().rgb()));
}
//slider
squeezesbslider = config.readBoolEntry( "Special_SqueezeSlider", false );
@@ -218,24 +218,24 @@ groupboxshadow = (style_ == Brushed) ? false : config.readBoolEntry( "Design_Sha
config.endGroup();
config.beginGroup("/baghira/Deco");
- titleButtonColor_[0] = QColor((unsigned int)config.readNumEntry( "CloseButtonColor", QColor(200,85,70).rgb()));
- titleButtonColor_[1] = QColor((unsigned int)config.readNumEntry( "MinButtonColor", QColor(230,155,40).rgb()));
- titleButtonColor_[2] = QColor((unsigned int)config.readNumEntry( "MaxButtonColor", QColor(121,180,54).rgb()));
+ titleButtonColor_[0] = TQColor((unsigned int)config.readNumEntry( "CloseButtonColor", TQColor(200,85,70).rgb()));
+ titleButtonColor_[1] = TQColor((unsigned int)config.readNumEntry( "MinButtonColor", TQColor(230,155,40).rgb()));
+ titleButtonColor_[2] = TQColor((unsigned int)config.readNumEntry( "MaxButtonColor", TQColor(121,180,54).rgb()));
if (style_ == Jaguar)
{
- titleColor_[0] = QColor((unsigned int)config.readNumEntry( "inactiveColor1_1", QColor(204,214,230).rgb()));
- titleColor_[1] = QColor((unsigned int)config.readNumEntry( "inactiveColor2_1", QColor(194,196,211).rgb()));
+ titleColor_[0] = TQColor((unsigned int)config.readNumEntry( "inactiveColor1_1", TQColor(204,214,230).rgb()));
+ titleColor_[1] = TQColor((unsigned int)config.readNumEntry( "inactiveColor2_1", TQColor(194,196,211).rgb()));
}
else if (style_ != Brushed)
{
- titleColor_[0] = QColor((unsigned int)config.readNumEntry( "activeColor1_2", QColor(238,238,238).rgb()));
- titleColor_[1] = QColor((unsigned int)config.readNumEntry( "activeColor2_2", QColor(205,202,205).rgb()));
+ titleColor_[0] = TQColor((unsigned int)config.readNumEntry( "activeColor1_2", TQColor(238,238,238).rgb()));
+ titleColor_[1] = TQColor((unsigned int)config.readNumEntry( "activeColor2_2", TQColor(205,202,205).rgb()));
}
if (style_ == Tiger)
{
int r,g,b;
- aDecoColor1_ = QColor((unsigned int)config.readNumEntry( "activeColor2_4", (unsigned int) QColor(205,202,205).rgb()));
- aDecoColor2_ = QColor((unsigned int)config.readNumEntry( "activeColor1_4", (unsigned int) QColor(238,238,238).rgb()));
+ aDecoColor1_ = TQColor((unsigned int)config.readNumEntry( "activeColor2_4", (unsigned int) TQColor(205,202,205).rgb()));
+ aDecoColor2_ = TQColor((unsigned int)config.readNumEntry( "activeColor1_4", (unsigned int) TQColor(238,238,238).rgb()));
r = (int)CLAMP(aDecoColor1_.red() * pow((double)aDecoColor1_.red() / (double)aDecoColor2_.red(),2.0),0,255);
g = (int)CLAMP(aDecoColor1_.green() * pow((double)aDecoColor1_.green() / (double)aDecoColor2_.green(),2.0),0,255);
b = (int)CLAMP(aDecoColor1_.blue() * pow((double)aDecoColor1_.blue() / (double)aDecoColor2_.blue(),2.0),0,255);
@@ -243,8 +243,8 @@ groupboxshadow = (style_ == Brushed) ? false : config.readBoolEntry( "Design_Sha
}
else
{
- aDecoColor1_ = Qt::black;
- aDecoColor2_ = Qt::black;
+ aDecoColor1_ = TQt::black;
+ aDecoColor2_ = TQt::black;
}
config.endGroup();
// Option gathered