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/viewmodes/viewsettingstab.cpp | |
| 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/viewmodes/viewsettingstab.cpp')
| -rw-r--r-- | src/settings/viewmodes/viewsettingstab.cpp | 60 |
1 files changed, 48 insertions, 12 deletions
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()); |
