diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2015-04-30 18:36:14 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2015-04-30 18:36:14 +0000 |
| commit | da552eeafbaac6ac4fef5deb302b355c024948ac (patch) | |
| tree | dddcf95341441a47efd2653d2f2b73275bd8b82e /src | |
| parent | 436aad0ab7cd4850f6c60228d6cd9298a9cd00de (diff) | |
| download | qmmp-da552eeafbaac6ac4fef5deb302b355c024948ac.tar.gz qmmp-da552eeafbaac6ac4fef5deb302b355c024948ac.tar.bz2 qmmp-da552eeafbaac6ac4fef5deb302b355c024948ac.zip | |
added feature to hide song lengths
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@4881 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src')
| -rw-r--r-- | src/plugins/Ui/skinned/listwidgetdrawer.cpp | 10 | ||||
| -rw-r--r-- | src/plugins/Ui/skinned/listwidgetdrawer.h | 1 | ||||
| -rw-r--r-- | src/plugins/Ui/skinned/skinnedsettings.cpp | 6 |
3 files changed, 11 insertions, 6 deletions
diff --git a/src/plugins/Ui/skinned/listwidgetdrawer.cpp b/src/plugins/Ui/skinned/listwidgetdrawer.cpp index 5380bfad8..abada6cce 100644 --- a/src/plugins/Ui/skinned/listwidgetdrawer.cpp +++ b/src/plugins/Ui/skinned/listwidgetdrawer.cpp @@ -36,6 +36,7 @@ ListWidgetDrawer::ListWidgetDrawer() m_show_anchor = false; m_show_number = false; m_align_numbres = false; + m_show_lengths = false; m_row_height = 0; m_number_width = 0; m_padding = 0; @@ -57,6 +58,7 @@ void ListWidgetDrawer::readSettings() settings.beginGroup("Skinned"); m_show_anchor = settings.value("pl_show_anchor", false).toBool(); m_show_number = settings.value ("pl_show_numbers", true).toBool(); + m_show_lengths = settings.value ("pl_show_lengths", true).toBool(); m_align_numbres = settings.value ("pl_align_numbers", false).toBool(); m_font.fromString(settings.value("pl_font", qApp->font().toString()).toString()); m_extra_font = m_font; @@ -117,12 +119,12 @@ void ListWidgetDrawer::prepareRow(ListWidgetRow *row) if(m_show_number && !m_align_numbres) row->titles[0].prepend(QString("%1").arg(row->number)+". "); - if(!row->length.isEmpty() || !row->extraString.isEmpty()) + if((m_show_lengths && !row->length.isEmpty()) || !row->extraString.isEmpty()) row->lengthColumnWidth = m_padding; else row->lengthColumnWidth = 0; - if(!row->length.isEmpty()) + if(m_show_lengths && !row->length.isEmpty()) row->lengthColumnWidth += m_metrics->width(row->length) + m_padding; if(!row->extraString.isEmpty()) @@ -253,7 +255,7 @@ void ListWidgetDrawer::drawTrack(QPainter *painter, ListWidgetRow *row, bool rtl sx = row->rect.x() + m_padding; painter->setPen(row->flags & ListWidgetRow::CURRENT ? m_current : m_normal); - if(!row->length.isEmpty()) + if(m_show_lengths && !row->length.isEmpty()) { painter->drawText(sx, sy, row->length); sx += m_metrics->width(row->length) + m_padding; @@ -297,7 +299,7 @@ void ListWidgetDrawer::drawTrack(QPainter *painter, ListWidgetRow *row, bool rtl sx = row->rect.right() - m_padding; painter->setPen(row->flags & ListWidgetRow::CURRENT ? m_current : m_normal); - if(!row->length.isEmpty()) + if(m_show_lengths && !row->length.isEmpty()) { sx -= m_metrics->width(row->length); painter->drawText(sx, sy, row->length); diff --git a/src/plugins/Ui/skinned/listwidgetdrawer.h b/src/plugins/Ui/skinned/listwidgetdrawer.h index b7f59a411..118d9e37b 100644 --- a/src/plugins/Ui/skinned/listwidgetdrawer.h +++ b/src/plugins/Ui/skinned/listwidgetdrawer.h @@ -91,6 +91,7 @@ private: bool m_show_number; bool m_show_anchor; bool m_align_numbres; + bool m_show_lengths; int m_padding; int m_number_width; int m_row_height; diff --git a/src/plugins/Ui/skinned/skinnedsettings.cpp b/src/plugins/Ui/skinned/skinnedsettings.cpp index c2702467c..848117026 100644 --- a/src/plugins/Ui/skinned/skinnedsettings.cpp +++ b/src/plugins/Ui/skinned/skinnedsettings.cpp @@ -221,8 +221,9 @@ void SkinnedSettings::readSettings() settings.beginGroup("Skinned"); //playlist m_ui.protocolCheckBox->setChecked(settings.value ("pl_show_protocol", false).toBool()); - m_ui.numbersCheckBox->setChecked(settings.value ("pl_show_numbers", true).toBool()); - m_ui.alignCheckBox->setChecked(settings.value ("pl_align_numbers", false).toBool()); + m_ui.numbersCheckBox->setChecked(settings.value("pl_show_numbers", true).toBool()); + m_ui.lengthsCheckBox->setChecked(settings.value("pl_show_lengths", true).toBool()); + m_ui.alignCheckBox->setChecked(settings.value("pl_align_numbers", false).toBool()); m_ui.anchorCheckBox->setChecked(settings.value("pl_show_anchor", false).toBool()); m_ui.playlistsCheckBox->setChecked(settings.value("pl_show_plalists", false).toBool()); m_ui.popupCheckBox->setChecked(settings.value("pl_show_popup", false).toBool()); @@ -246,6 +247,7 @@ void SkinnedSettings::writeSettings() settings.beginGroup("Skinned"); settings.setValue ("pl_show_protocol", m_ui.protocolCheckBox->isChecked()); settings.setValue ("pl_show_numbers", m_ui.numbersCheckBox->isChecked()); + settings.setValue ("pl_show_lengths", m_ui.lengthsCheckBox->isChecked()); settings.setValue ("pl_align_numbers", m_ui.alignCheckBox->isChecked()); settings.setValue ("pl_show_anchor", m_ui.anchorCheckBox->isChecked()); settings.setValue ("pl_show_plalists", m_ui.playlistsCheckBox->isChecked()); |
