[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    playground/base/colors2
From:       Matthew Woehlke <mw_triad () users ! sourceforge ! net>
Date:       2007-09-01 2:39:16
Message-ID: 1188614356.961355.30502.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 707096 by mwoehlke:

add the UI code for the 'Scheme' tab... the 'Effects' tab is coming later


 M  +74 -3     colorscm.cpp  


--- trunk/playground/base/colors2/colorscm.cpp #707095:707096
@@ -17,10 +17,13 @@
  * Boston, MA 02110-1301, USA.
  */
 
+// FIXME QFrame included only for placeholders
+
+#include <QtGui/QLayout>
+#include <QtGui/QGroupBox>
+#include <QtGui/QPushButton>
+#include <QtGui/QComboBox>
 #include <QtGui/QCheckBox>
-#include <QtGui/QComboBox>
-#include <QtGui/QLabel>
-#include <QtGui/QLayout>
 #include <QtGui/QSlider>
 
 #include <KColorButton>
@@ -45,6 +48,74 @@
     about->addAuthor( ki18n("Matthew Woehlke"), KLocalizedString(),
                      "mw_triad@users.sourceforge.net" );
     setAboutData( about );
+
+    // root tab widget
+    QVBoxLayout *mainLayout = new QVBoxLayout( this );
+    mainLayout->setMargin(0);
+    QTabWidget *tabWidget = new QTabWidget( this );
+    mainLayout->addWidget( tabWidget );
+
+    // scheme page
+    QWidget *schemePage = new QWidget;
+    QGridLayout *schemePageLayout = new QGridLayout( schemePage );
+    QFrame *preview = new QFrame; // TODO
+    schemePageLayout->addWidget( preview, 0, 0, 1, 2 );
+
+    QGroupBox *schemeBox = new QGroupBox( "Color Scheme" );
+    QGridLayout *schemeLayout = new QGridLayout();
+    schemeBox->setLayout( schemeLayout );
+    KListWidget *schemeList = new KListWidget();
+    schemeLayout->addWidget( schemeList, 0, 0, 1, 3 );
+    QPushButton *schemeSaveButton = new QPushButton( "&Save..." );
+    QPushButton *schemeRemoveButton = new QPushButton( "Rem&ove" );
+    QPushButton *schemeImportButton = new QPushButton( "I&mport..." );
+    schemeLayout->addWidget( schemeSaveButton, 1, 0 );
+    schemeLayout->addWidget( schemeRemoveButton, 1, 1 );
+    schemeLayout->addWidget( schemeImportButton, 1, 2 );
+    schemePageLayout->addWidget( schemeBox, 1, 0, 3, 1 );
+
+    QGroupBox *colorsBox = new QGroupBox( "Colors" );
+    QVBoxLayout *colorsLayout = new QVBoxLayout();
+    colorsBox->setLayout( colorsLayout );
+    QComboBox *colorSet = new QComboBox;
+    colorSet->addItem( "Common Colors" );
+    colorSet->addItem( "  View" );
+    colorSet->addItem( "  Window" );
+    colorSet->addItem( "  Button" );
+    colorSet->addItem( "  Selection" );
+    colorSet->addItem( "  Tooltip" );
+    colorsLayout->addWidget( colorSet );
+    KListWidget *colorList = new KListWidget();
+    colorsLayout->addWidget( colorList );
+    schemePageLayout->addWidget( colorsBox, 1, 1 );
+
+    QCheckBox *shadeSortedColumn = new QCheckBox( "Shade sorted &column in lists" );
+    schemePageLayout->addWidget( shadeSortedColumn, 2, 1 );
+
+    QGroupBox *contrastBox = new QGroupBox( "Con&trast" );
+    QHBoxLayout *contrastLayout = new QHBoxLayout();
+    contrastBox->setLayout( contrastLayout );
+    QSlider *contrastSlider = new QSlider( Qt::Horizontal );
+    contrastSlider->setRange( 0, 10 );
+    contrastSlider->setSingleStep( 1 );
+    contrastSlider->setPageStep( 5 );
+    contrastLayout->addWidget( contrastSlider );
+    schemePageLayout->addWidget( contrastBox, 3, 1 );
+
+    QCheckBox *applyToAlien = new QCheckBox( "Apply colors to &non-KDE4 applications" );
+    schemePageLayout->addWidget( applyToAlien, 4, 0, 1, 2 );
+
+    // effects page
+    QWidget *effectsPage = new QWidget;
+    QVBoxLayout *effectsPageLayout = new QVBoxLayout( effectsPage );
+    // TODO
+
+    // connect signals/slots
+    // TODO
+
+    // finally, add UI's to tab widget
+    tabWidget->addTab( schemePage, i18n("&Scheme"));
+    tabWidget->addTab( effectsPage, i18n("&Effects"));
 }
 
 KColorCm::~KColorCm()
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic