]> cloud.milkyroute.net Git - dolphin.git/commitdiff
* align labels on the right like suggested in the KDE 4 HIG
authorPeter Penz <peter.penz19@gmail.com>
Tue, 26 Aug 2008 23:01:56 +0000 (23:01 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Tue, 26 Aug 2008 23:01:56 +0000 (23:01 +0000)
* minor changes in detailsview settings and columnview settings

svn path=/trunk/KDE/kdebase/apps/; revision=852982

src/columnviewsettingspage.cpp
src/columnviewsettingspage.h
src/detailsviewsettingspage.cpp
src/iconsizegroupbox.cpp
src/iconsviewsettingspage.cpp
src/viewpropertiesdialog.cpp

index e59492a92700d7ab9da73d8ccfea43ffa48bdbed..cecc5f14ee062ad72a040241498ea47777e25324 100644 (file)
@@ -41,7 +41,7 @@ ColumnViewSettingsPage::ColumnViewSettingsPage(QWidget* parent) :
     ViewSettingsPageBase(parent),
     m_iconSizeGroupBox(0),
     m_fontRequester(0),
-    m_columnWidthSlider(0)
+    m_textWidthBox(0)
 {
     const int spacing = KDialog::spacingHint();
     const int margin = KDialog::marginHint();
@@ -65,34 +65,25 @@ ColumnViewSettingsPage::ColumnViewSettingsPage(QWidget* parent) :
             this, SIGNAL(changed()));
 
     // create "Text" properties
-    QGroupBox* textBox = new QGroupBox(i18nc("@title:group", "Text"), this);
-    textBox->setSizePolicy(sizePolicy);
+    QGroupBox* textGroup = new QGroupBox(i18nc("@title:group", "Text"), this);
+    textGroup->setSizePolicy(sizePolicy);
 
-    QLabel* fontLabel = new QLabel(i18nc("@label:listbox", "Font:"), textBox);
-    m_fontRequester = new DolphinFontRequester(textBox);
+    QLabel* fontLabel = new QLabel(i18nc("@label:listbox", "Font:"), textGroup);
+    m_fontRequester = new DolphinFontRequester(textGroup);
     connect(m_fontRequester, SIGNAL(changed()), this, SIGNAL(changed()));
 
-    QHBoxLayout* textLayout = new QHBoxLayout(textBox);
-    textLayout->addWidget(fontLabel);
-    textLayout->addWidget(m_fontRequester);
+    QLabel* textWidthLabel = new QLabel(i18nc("@label:listbox", "Text width:"), textGroup);
+    m_textWidthBox = new QComboBox(textGroup);
+    m_textWidthBox->addItem(i18nc("@item:inlistbox Text width", "Small"));
+    m_textWidthBox->addItem(i18nc("@item:inlistbox Text width", "Medium"));
+    m_textWidthBox->addItem(i18nc("@item:inlistbox Text width", "Large"));
+    connect(m_textWidthBox, SIGNAL(activated(int)), this, SIGNAL(changed()));
 
-    // create "Column Width" properties
-    QGroupBox* columnWidthBox = new QGroupBox(i18nc("@title:group", "Column Width"), this);
-    columnWidthBox->setSizePolicy(sizePolicy);
-
-    QLabel* smallLabel = new QLabel(i18nc("@item:inrange Column Width", "Small"), columnWidthBox);
-    m_columnWidthSlider = new QSlider(Qt::Horizontal, columnWidthBox);
-    m_columnWidthSlider->setMinimum(0);
-    m_columnWidthSlider->setMaximum(5);
-    m_columnWidthSlider->setPageStep(1);
-    m_columnWidthSlider->setTickPosition(QSlider::TicksBelow);
-    QLabel* largeLabel = new QLabel(i18nc("@item:inrange Column Width", "Large"), columnWidthBox);
-    connect(m_columnWidthSlider, SIGNAL(valueChanged(int)), this, SIGNAL(changed()));
-
-    QHBoxLayout* columnWidthLayout = new QHBoxLayout(columnWidthBox);
-    columnWidthLayout->addWidget(smallLabel);
-    columnWidthLayout->addWidget(m_columnWidthSlider);
-    columnWidthLayout->addWidget(largeLabel);
+    QGridLayout* textGroupLayout = new QGridLayout(textGroup);
+    textGroupLayout->addWidget(fontLabel, 0, 0, Qt::AlignRight);
+    textGroupLayout->addWidget(m_fontRequester, 0, 1);
+    textGroupLayout->addWidget(textWidthLabel, 1, 0, Qt::AlignRight);
+    textGroupLayout->addWidget(m_textWidthBox, 1, 1);
 
     // Add a dummy widget with no restriction regarding
     // a vertical resizing. This assures that the dialog layout
@@ -122,8 +113,9 @@ void ColumnViewSettingsPage::applySettings()
     settings->setItalicFont(font.italic());
     settings->setFontWeight(font.weight());
 
-    const int columnWidth = 150 + (m_columnWidthSlider->value() * 50);
-    settings->setColumnWidth(columnWidth);
+    // TODO:
+    //const int columnWidth = 150 + (m_columnWidthSlider->value() * 50);
+    //settings->setColumnWidth(columnWidth);
 }
 
 void ColumnViewSettingsPage::restoreDefaults()
@@ -156,7 +148,8 @@ void ColumnViewSettingsPage::loadSettings()
         m_fontRequester->setCustomFont(font);
     }
 
-    m_columnWidthSlider->setValue((settings->columnWidth() - 150) / 50);
+    // TODO:
+    //m_columnWidthSlider->setValue((settings->columnWidth() - 150) / 50);
 }
 
 #include "columnviewsettingspage.moc"
index 2cc96b2031a3b87fcb2573e4173af704ae4c6123..a797a570514a731d29d7c910769022652157dbb2 100644 (file)
@@ -25,7 +25,7 @@
 class DolphinMainWindow;
 class DolphinFontRequester;
 class IconSizeGroupBox;
-class QSlider;
+class QComboBox;
 
 /**
  * @brief Represents the page from the Dolphin Settings which allows
@@ -55,7 +55,7 @@ private:
 private:
     IconSizeGroupBox* m_iconSizeGroupBox;
     DolphinFontRequester* m_fontRequester;
-    QSlider* m_columnWidthSlider;
+    QComboBox* m_textWidthBox;
 };
 
 #endif
index 74fc3567d2ccfdacc2292b86561f86422498239e..190c9138e0d5c098b680729ba45f5990db365f05 100644 (file)
@@ -65,17 +65,17 @@ DetailsViewSettingsPage::DetailsViewSettingsPage(QWidget* parent) :
             this, SIGNAL(changed()));
 
     // create "Text" properties
-    QGroupBox* textBox = new QGroupBox(i18nc("@title:group", "Text"), this);
-    textBox->setSizePolicy(sizePolicy);
-
-    QLabel* fontLabel = new QLabel(i18nc("@label:listbox", "Font:"), textBox);
-    m_fontRequester = new DolphinFontRequester(textBox);
+    QWidget* textGroup = new QWidget(this);
+    textGroup->setSizePolicy(sizePolicy);
+    
+    QLabel* fontLabel = new QLabel(i18nc("@label:listbox", "Font:"), textGroup);
+    m_fontRequester = new DolphinFontRequester(textGroup);
     connect(m_fontRequester, SIGNAL(changed()), this, SIGNAL(changed()));
 
-    QHBoxLayout* textLayout = new QHBoxLayout(textBox);
-    textLayout->addWidget(fontLabel);
+    QHBoxLayout* textLayout = new QHBoxLayout(textGroup);
+    textLayout->addWidget(fontLabel, 0, Qt::AlignRight);
     textLayout->addWidget(m_fontRequester);
-
+    
     // create "Expandable Folders" checkbox
     m_expandableFolders = new QCheckBox(i18nc("@option:check", "Expandable Folders"), this);
     connect(m_expandableFolders, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
index 8f6c240865abb72eb0d01f4a44e2e79303c64b1e..d532f340ff17add93e6884fc21d6b3c67d914f1e 100644 (file)
@@ -45,9 +45,9 @@ IconSizeGroupBox::IconSizeGroupBox(QWidget* parent) :
             this, SIGNAL(defaultSizeChanged(int)));
     
     QGridLayout* layout = new QGridLayout(this);
-    layout->addWidget(defaultLabel, 0, 0);
+    layout->addWidget(defaultLabel, 0, 0, Qt::AlignRight);
     layout->addWidget(m_defaultSizeSlider, 0, 1);
-    layout->addWidget(previewLabel, 1, 0);
+    layout->addWidget(previewLabel, 1, 0, Qt::AlignRight);
     layout->addWidget(m_previewSizeSlider, 1, 1);
 }
 
index 91208e2c765cd85fb13c6b5509f6efe911896997..0a6aed67f43fc2a566a465b8361f80342c0c6924 100644 (file)
@@ -94,11 +94,11 @@ IconsViewSettingsPage::IconsViewSettingsPage(QWidget* parent) :
     connect(m_textWidthBox, SIGNAL(activated(int)), this, SIGNAL(changed()));
 
     QGridLayout* textGroupLayout = new QGridLayout(textGroup);
-    textGroupLayout->addWidget(fontLabel, 0, 0);
+    textGroupLayout->addWidget(fontLabel, 0, 0, Qt::AlignRight);
     textGroupLayout->addWidget(m_fontRequester, 0, 1);
-    textGroupLayout->addWidget(textlinesCountLabel, 1, 0);
+    textGroupLayout->addWidget(textlinesCountLabel, 1, 0, Qt::AlignRight);
     textGroupLayout->addWidget(m_textlinesCountBox, 1, 1);
-    textGroupLayout->addWidget(textWidthLabel, 2, 0);
+    textGroupLayout->addWidget(textWidthLabel, 2, 0, Qt::AlignRight);
     textGroupLayout->addWidget(m_textWidthBox, 2, 1);
 
     // create the 'Grid' group for selecting the arrangement and the grid spacing
@@ -119,9 +119,9 @@ IconsViewSettingsPage::IconsViewSettingsPage(QWidget* parent) :
     connect(m_gridSpacingBox, SIGNAL(activated(int)), this, SIGNAL(changed()));
 
     QGridLayout* gridGroupLayout = new QGridLayout(gridGroup);
-    gridGroupLayout->addWidget(arrangementLabel, 0, 0);
+    gridGroupLayout->addWidget(arrangementLabel, 0, 0, Qt::AlignRight);
     gridGroupLayout->addWidget(m_arrangementBox, 0, 1);
-    gridGroupLayout->addWidget(gridSpacingLabel, 1, 0);
+    gridGroupLayout->addWidget(gridSpacingLabel, 1, 0, Qt::AlignRight);
     gridGroupLayout->addWidget(m_gridSpacingBox, 1, 1);
 
     // Add a dummy widget with no restriction regarding
index aab0309b88b5a79bfc28ecaeb80ae1bafce31717..b71732e5648707bc4647572b865f30115fd09320 100644 (file)
@@ -135,9 +135,9 @@ ViewPropertiesDialog::ViewPropertiesDialog(DolphinView* dolphinView) :
     sortingBox->setLayout(sortingLayout);
 
     QGridLayout* propsGridLayout = new QGridLayout(propsGrid);
-    propsGridLayout->addWidget(viewModeLabel, 0, 0);
+    propsGridLayout->addWidget(viewModeLabel, 0, 0, Qt::AlignRight);
     propsGridLayout->addWidget(m_viewMode, 0, 1);
-    propsGridLayout->addWidget(sortingLabel, 1, 0);
+    propsGridLayout->addWidget(sortingLabel, 1, 0, Qt::AlignRight);
     propsGridLayout->addWidget(sortingBox, 1, 1);
 
     QVBoxLayout* propsBoxLayout = new QVBoxLayout(propsBox);