Frontend look fixes
authorunc0rr
Thu, 19 Feb 2009 14:52:32 +0000
changeset 1810 4059cafd1da7
parent 1809 77923087a1ce
child 1811 1b9e33623b7e
Frontend look fixes
QTfrontend/igbox.cpp
QTfrontend/igbox.h
QTfrontend/mapContainer.cpp
QTfrontend/pages.cpp
--- a/QTfrontend/igbox.cpp	Thu Feb 19 14:51:57 2009 +0000
+++ b/QTfrontend/igbox.cpp	Thu Feb 19 14:52:32 2009 +0000
@@ -25,7 +25,8 @@
 
 IconedGroupBox::IconedGroupBox(QWidget * parent)
 {
-	padding = 82;
+	titleLeftPadding = 82;
+    contentTopPadding = 22;
 }
 
 void IconedGroupBox::setIcon(const QIcon & icon)
@@ -35,16 +36,16 @@
 			"IconedGroupBox{"
 				"margin-top: 46px;"
 				"margin-left: 12px;"
-				"padding: 22px 0px 0px 0px;"
+                "padding: %1px 2px 5px 2px;"
 				"}"
 			"IconedGroupBox::title{"
 				"subcontrol-origin: margin;"
 				"subcontrol-position: top left;"
-				"padding-left: %1px;"
-				"padding-top: 26px;"
+				"padding-left: %2px;"
+				"padding-top: 25px;"
 				"text-align: left;"
 				"}"
-				).arg(padding)
+				).arg(contentTopPadding).arg(titleLeftPadding)
 		);
 
 	this->icon = icon;
@@ -64,5 +65,10 @@
 
 void IconedGroupBox::setTitleTextPadding(int px)
 {
-	padding = px;
+	titleLeftPadding = px;
 }
+
+void IconedGroupBox::setContentTopPadding(int px)
+{
+	contentTopPadding = px;
+}
--- a/QTfrontend/igbox.h	Thu Feb 19 14:51:57 2009 +0000
+++ b/QTfrontend/igbox.h	Thu Feb 19 14:52:32 2009 +0000
@@ -31,12 +31,14 @@
 
 	void setIcon(const QIcon & icon);
 	void setTitleTextPadding(int px);
+	void setContentTopPadding(int px);
 protected:
 	virtual void paintEvent(QPaintEvent * event);
 
 private:
 	QIcon icon;
-	int padding;
+	int titleLeftPadding;
+	int contentTopPadding;
 };
 
 #endif // _IGBOX_H
--- a/QTfrontend/mapContainer.cpp	Thu Feb 19 14:51:57 2009 +0000
+++ b/QTfrontend/mapContainer.cpp	Thu Feb 19 14:52:32 2009 +0000
@@ -106,6 +106,7 @@
 
 	gbThemes = new IconedGroupBox(this);
 	gbThemes->setTitleTextPadding(60);
+	gbThemes->setContentTopPadding(6);
 	gbThemes->setTitle(tr("Themes"));
 
 	//gbThemes->setStyleSheet("padding: 0px"); // doesn't work - stylesheet is set with icon
--- a/QTfrontend/pages.cpp	Thu Feb 19 14:51:57 2009 +0000
+++ b/QTfrontend/pages.cpp	Thu Feb 19 14:52:32 2009 +0000
@@ -348,6 +348,7 @@
 
 	{
 		IconedGroupBox* groupWeapons = new IconedGroupBox(this);
+        groupWeapons->setContentTopPadding(0);
 		groupWeapons->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
 		groupWeapons->setIcon(QIcon(":/res/weaponsicon.png"));
 		//groupWeapons->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);