diff options
| author | Peter Penz <[email protected]> | 2012-04-14 00:22:08 +0200 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2012-04-14 00:28:24 +0200 |
| commit | 60b868108151463a702e8c10933b0ceb99f11bbe (patch) | |
| tree | 97b5a6aeca8df6b121674d38b11ea69b11b7878a /src/settings | |
| parent | 31ee4085c2b2c374158fb956ac376399ff375b5a (diff) | |
Allow to optionally limit the maximum number of text lines
Showing the whole filename unclipped seems to be a good default,
however for users with a lot of files that have extremely long names
this might get a problem especially in the icons-view.
- Allow to limit the maximum number of lines in the icons-view
- Allow to specify a maximum width in the compact-view
(No limit is required for the details-view, as the name is shortened
automatically to show other columns)
BUG: 288596
FIXED-IN: 4.9.0
Diffstat (limited to 'src/settings')
| -rw-r--r-- | src/settings/dolphin_compactmodesettings.kcfg | 4 | ||||
| -rw-r--r-- | src/settings/dolphin_iconsmodesettings.kcfg | 4 | ||||
| -rw-r--r-- | src/settings/viewmodes/viewsettingstab.cpp | 60 | ||||
| -rw-r--r-- | src/settings/viewmodes/viewsettingstab.h | 3 |
4 files changed, 58 insertions, 13 deletions
diff --git a/src/settings/dolphin_compactmodesettings.kcfg b/src/settings/dolphin_compactmodesettings.kcfg index 40b9dfa32..b9000c8e2 100644 --- a/src/settings/dolphin_compactmodesettings.kcfg +++ b/src/settings/dolphin_compactmodesettings.kcfg @@ -36,5 +36,9 @@ <label>Preview size</label> <default code="true">KIconLoader::SizeLarge</default> </entry> + <entry name="MaximumTextWidthIndex" type="Int"> + <label>Maximum text width index (0 means unlimited)</label> + <default>0</default> + </entry> </group> </kcfg> diff --git a/src/settings/dolphin_iconsmodesettings.kcfg b/src/settings/dolphin_iconsmodesettings.kcfg index fb01a8c65..52cd9a28c 100644 --- a/src/settings/dolphin_iconsmodesettings.kcfg +++ b/src/settings/dolphin_iconsmodesettings.kcfg @@ -40,5 +40,9 @@ <label>Text width index</label> <default>1</default> </entry> + <entry name="MaximumTextLines" type="Int"> + <label>Maximum textlines (0 means unlimited)</label> + <default>0</default> + </entry> </group> </kcfg> diff --git a/src/settings/viewmodes/viewsettingstab.cpp b/src/settings/viewmodes/viewsettingstab.cpp index 23b2999b1..fe043a788 100644 --- a/src/settings/viewmodes/viewsettingstab.cpp +++ b/src/settings/viewmodes/viewsettingstab.cpp @@ -41,7 +41,8 @@ ViewSettingsTab::ViewSettingsTab(Mode mode, QWidget* parent) : m_defaultSizeSlider(0), m_previewSizeSlider(0), m_fontRequester(0), - m_textWidthBox(0), + m_widthBox(0), + m_maxLinesBox(0), m_expandableFolders(0) { QVBoxLayout* topLayout = new QVBoxLayout(this); @@ -83,15 +84,38 @@ ViewSettingsTab::ViewSettingsTab(Mode mode, QWidget* parent) : switch (m_mode) { case IconsMode: { - QLabel* textWidthLabel = new QLabel(i18nc("@label:listbox", "Text width:"), textGroup); - m_textWidthBox = new KComboBox(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")); - m_textWidthBox->addItem(i18nc("@item:inlistbox Text width", "Huge")); + QLabel* widthLabel = new QLabel(i18nc("@label:listbox", "Width:"), textGroup); + m_widthBox = new KComboBox(textGroup); + m_widthBox->addItem(i18nc("@item:inlistbox Text width", "Small")); + m_widthBox->addItem(i18nc("@item:inlistbox Text width", "Medium")); + m_widthBox->addItem(i18nc("@item:inlistbox Text width", "Large")); + m_widthBox->addItem(i18nc("@item:inlistbox Text width", "Huge")); - textGroupLayout->addWidget(textWidthLabel, 2, 0, Qt::AlignRight); - textGroupLayout->addWidget(m_textWidthBox, 2, 1); + QLabel* maxLinesLabel = new QLabel(i18nc("@label:listbox", "Maximum lines:"), textGroup); + m_maxLinesBox = new KComboBox(textGroup); + m_maxLinesBox->addItem(i18nc("@item:inlistbox Maximum lines", "Unlimited")); + m_maxLinesBox->addItem(i18nc("@item:inlistbox Maximum lines", "1")); + m_maxLinesBox->addItem(i18nc("@item:inlistbox Maximum lines", "2")); + m_maxLinesBox->addItem(i18nc("@item:inlistbox Maximum lines", "3")); + m_maxLinesBox->addItem(i18nc("@item:inlistbox Maximum lines", "4")); + m_maxLinesBox->addItem(i18nc("@item:inlistbox Maximum lines", "5")); + + textGroupLayout->addWidget(widthLabel, 2, 0, Qt::AlignRight); + textGroupLayout->addWidget(m_widthBox, 2, 1); + textGroupLayout->addWidget(maxLinesLabel, 3, 0, Qt::AlignRight); + textGroupLayout->addWidget(m_maxLinesBox, 3, 1); + break; + } + case CompactMode: { + QLabel* maxWidthLabel = new QLabel(i18nc("@label:listbox", "Maximum width:"), textGroup); + m_widthBox = new KComboBox(textGroup); + m_widthBox->addItem(i18nc("@item:inlistbox Maximum width", "Unlimited")); + m_widthBox->addItem(i18nc("@item:inlistbox Maximum width", "Small")); + m_widthBox->addItem(i18nc("@item:inlistbox Maximum width", "Medium")); + m_widthBox->addItem(i18nc("@item:inlistbox Maximum width", "Large")); + + textGroupLayout->addWidget(maxWidthLabel, 2, 0, Qt::AlignRight); + textGroupLayout->addWidget(m_widthBox, 2, 1); break; } case DetailsMode: @@ -114,7 +138,11 @@ ViewSettingsTab::ViewSettingsTab(Mode mode, QWidget* parent) : switch (m_mode) { case IconsMode: - connect(m_textWidthBox, SIGNAL(currentIndexChanged(int)), this, SIGNAL(changed())); + connect(m_widthBox, SIGNAL(currentIndexChanged(int)), this, SIGNAL(changed())); + connect(m_maxLinesBox, SIGNAL(currentIndexChanged(int)), this, SIGNAL(changed())); + break; + case CompactMode: + connect(m_widthBox, SIGNAL(currentIndexChanged(int)), this, SIGNAL(changed())); break; case DetailsMode: connect(m_expandableFolders, SIGNAL(toggled(bool)), this, SIGNAL(changed())); @@ -135,7 +163,11 @@ void ViewSettingsTab::applySettings() switch (m_mode) { case IconsMode: - IconsModeSettings::setTextWidthIndex(m_textWidthBox->currentIndex()); + IconsModeSettings::setTextWidthIndex(m_widthBox->currentIndex()); + IconsModeSettings::setMaximumTextLines(m_maxLinesBox->currentIndex()); + break; + case CompactMode: + CompactModeSettings::setMaximumTextWidthIndex(m_widthBox->currentIndex()); break; case DetailsMode: DetailsModeSettings::setExpandableFolders(m_expandableFolders->isChecked()); @@ -179,7 +211,11 @@ void ViewSettingsTab::loadSettings() { switch (m_mode) { case IconsMode: - m_textWidthBox->setCurrentIndex(IconsModeSettings::textWidthIndex()); + m_widthBox->setCurrentIndex(IconsModeSettings::textWidthIndex()); + m_maxLinesBox->setCurrentIndex(IconsModeSettings::maximumTextLines()); + break; + case CompactMode: + m_widthBox->setCurrentIndex(CompactModeSettings::maximumTextWidthIndex()); break; case DetailsMode: m_expandableFolders->setChecked(DetailsModeSettings::expandableFolders()); diff --git a/src/settings/viewmodes/viewsettingstab.h b/src/settings/viewmodes/viewsettingstab.h index b21fc102c..2115da1bc 100644 --- a/src/settings/viewmodes/viewsettingstab.h +++ b/src/settings/viewmodes/viewsettingstab.h @@ -63,7 +63,8 @@ private: QSlider* m_previewSizeSlider; DolphinFontRequester* m_fontRequester; - KComboBox* m_textWidthBox; + KComboBox* m_widthBox; + KComboBox* m_maxLinesBox; QCheckBox* m_expandableFolders; }; |
