diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2011-08-07 18:51:07 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2011-08-07 18:51:07 +0000 |
| commit | b1a02c986779d4e065eae15c2c34f92246bcc77d (patch) | |
| tree | 46c69a3c8c5900c180e2157055d462bd930d13bb /src/plugins | |
| parent | c41f44356491c77aa9a5e8083e7135e50ee753ea (diff) | |
| download | qmmp-b1a02c986779d4e065eae15c2c34f92246bcc77d.tar.gz qmmp-b1a02c986779d4e065eae15c2c34f92246bcc77d.tar.bz2 qmmp-b1a02c986779d4e065eae15c2c34f92246bcc77d.zip | |
added text scroller background setting
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@2295 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins')
18 files changed, 132 insertions, 39 deletions
diff --git a/src/plugins/Ui/skinned/textscroller.cpp b/src/plugins/Ui/skinned/textscroller.cpp index 122314f8b..678068eaa 100644 --- a/src/plugins/Ui/skinned/textscroller.cpp +++ b/src/plugins/Ui/skinned/textscroller.cpp @@ -28,13 +28,13 @@ #include <qmmp/soundcore.h> #include <qmmpui/metadataformatter.h> #include "skin.h" +#include "actionmanager.h" #include "textscroller.h" #define SCROLL_SEP " *** " #define TITLE_FORMAT "%if(%p&%t,%p - %t,%p%t)%if(%p&%t,,%f)%if(%l, - %l,)" -TextScroller::TextScroller (QWidget *parent) - : QWidget (parent) +TextScroller::TextScroller (QWidget *parent) : QWidget (parent) { m_pressed = false; m_press_pos = 0; @@ -49,14 +49,17 @@ TextScroller::TextScroller (QWidget *parent) m_timer->start(); m_menu = new QMenu(this); - m_scrollAction = m_menu->addAction(tr("Autoscroll Songname")); + m_menu->addAction(ACTION(ActionManager::PL_SHOW_INFO)); + m_menu->addSeparator(); + m_scrollAction = m_menu->addAction(tr("Autoscroll Songname"), this, SLOT(updateText())); + m_transparencyAction = m_menu->addAction(tr("Transparent Background"), this, SLOT(updateText())); m_scrollAction->setCheckable(true); + m_transparencyAction->setCheckable(true); connect(m_scrollAction, SIGNAL(toggled(bool)), SLOT(updateText())); connect(m_timer, SIGNAL (timeout()), SLOT (addOffset())); connect(m_skin, SIGNAL(skinChanged()), SLOT(updateSkin())); connect(m_core, SIGNAL(stateChanged(Qmmp::State)), SLOT(processState(Qmmp::State))); connect(m_core, SIGNAL(metaDataChanged()), SLOT(processMetaData())); - //readSettings(); updateSkin(); } @@ -64,6 +67,7 @@ TextScroller::~TextScroller() { QSettings settings(Qmmp::configFile(), QSettings::IniFormat); settings.setValue("Skinned/autoscroll", m_scrollAction->isChecked()); + settings.setValue("Skinned/scroller_transparency", m_transparencyAction->isChecked()); if(m_metrics) delete m_metrics; } @@ -107,7 +111,10 @@ void TextScroller::updateSkin() if (m_metrics) delete m_metrics; else + { m_scrollAction->setChecked(settings.value("Skinned/autoscroll", true).toBool()); + m_transparencyAction->setChecked(settings.value("Skinned/scroller_transparency", true).toBool()); + } m_metrics = new QFontMetrics(m_font); updateText(); } @@ -256,7 +263,10 @@ void TextScroller::preparePixmap(const QString &text, bool scrollable) fullText.append(text + SCROLL_SEP); } m_pixmap = QPixmap(width,15*m_ratio); - m_pixmap.fill(Qt::transparent); + if(m_transparencyAction->isChecked()) + m_pixmap.fill(Qt::transparent); + else + m_pixmap.fill(QString(Skin::instance()->getPLValue("normalbg"))); QPainter painter(&m_pixmap); painter.setPen(m_color); painter.setFont(m_font); @@ -270,7 +280,10 @@ void TextScroller::preparePixmap(const QString &text, bool scrollable) else { m_pixmap = QPixmap(150*m_ratio,15*m_ratio); - m_pixmap.fill(Qt::transparent); + if(m_transparencyAction->isChecked()) + m_pixmap.fill(Qt::transparent); + else + m_pixmap.fill(QString(Skin::instance()->getPLValue("normalbg"))); QPainter painter(&m_pixmap); painter.setPen(m_color); painter.setFont(m_font); diff --git a/src/plugins/Ui/skinned/textscroller.h b/src/plugins/Ui/skinned/textscroller.h index 3fe50bf7e..12b30ad43 100644 --- a/src/plugins/Ui/skinned/textscroller.h +++ b/src/plugins/Ui/skinned/textscroller.h @@ -74,7 +74,7 @@ private: QColor m_color; QTimer *m_timer; QMenu *m_menu; - QAction *m_scrollAction; + QAction *m_scrollAction, *m_transparencyAction; SoundCore *m_core; }; diff --git a/src/plugins/Ui/skinned/translations/skinned_plugin_cs.ts b/src/plugins/Ui/skinned/translations/skinned_plugin_cs.ts index ffed1aaa2..fbdfe9fec 100644 --- a/src/plugins/Ui/skinned/translations/skinned_plugin_cs.ts +++ b/src/plugins/Ui/skinned/translations/skinned_plugin_cs.ts @@ -1267,12 +1267,17 @@ Andrey Adreev <andreev00@gmail.com></source> <context> <name>TextScroller</name> <message> - <location filename="../textscroller.cpp" line="52"/> + <location filename="../textscroller.cpp" line="54"/> <source>Autoscroll Songname</source> <translation>Automaticky rolovat název skladby</translation> </message> <message> - <location filename="../textscroller.cpp" line="117"/> + <location filename="../textscroller.cpp" line="55"/> + <source>Transparent Background</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../textscroller.cpp" line="124"/> <source>Buffering: %1%</source> <translation type="unfinished"></translation> </message> diff --git a/src/plugins/Ui/skinned/translations/skinned_plugin_de.ts b/src/plugins/Ui/skinned/translations/skinned_plugin_de.ts index 38612570d..f3b9fc081 100644 --- a/src/plugins/Ui/skinned/translations/skinned_plugin_de.ts +++ b/src/plugins/Ui/skinned/translations/skinned_plugin_de.ts @@ -1267,12 +1267,17 @@ Andrey Adreev <andreev00@gmail.com></source> <context> <name>TextScroller</name> <message> - <location filename="../textscroller.cpp" line="52"/> + <location filename="../textscroller.cpp" line="54"/> <source>Autoscroll Songname</source> <translation>Automatischer Bildlauf des Titelnamens</translation> </message> <message> - <location filename="../textscroller.cpp" line="117"/> + <location filename="../textscroller.cpp" line="55"/> + <source>Transparent Background</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../textscroller.cpp" line="124"/> <source>Buffering: %1%</source> <translation>Pufferung: %1 %</translation> </message> diff --git a/src/plugins/Ui/skinned/translations/skinned_plugin_es.ts b/src/plugins/Ui/skinned/translations/skinned_plugin_es.ts index 3520d981e..47a056403 100644 --- a/src/plugins/Ui/skinned/translations/skinned_plugin_es.ts +++ b/src/plugins/Ui/skinned/translations/skinned_plugin_es.ts @@ -1267,12 +1267,17 @@ Andrey Adreev <andreev00@gmail.com></source> <context> <name>TextScroller</name> <message> - <location filename="../textscroller.cpp" line="52"/> + <location filename="../textscroller.cpp" line="54"/> <source>Autoscroll Songname</source> <translation>Autodesplazar el nombre de la canción</translation> </message> <message> - <location filename="../textscroller.cpp" line="117"/> + <location filename="../textscroller.cpp" line="55"/> + <source>Transparent Background</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../textscroller.cpp" line="124"/> <source>Buffering: %1%</source> <translation>Cargando: %1%</translation> </message> diff --git a/src/plugins/Ui/skinned/translations/skinned_plugin_hu.ts b/src/plugins/Ui/skinned/translations/skinned_plugin_hu.ts index e1ea8e54c..b37f7c856 100644 --- a/src/plugins/Ui/skinned/translations/skinned_plugin_hu.ts +++ b/src/plugins/Ui/skinned/translations/skinned_plugin_hu.ts @@ -1267,12 +1267,17 @@ Andrey Adreev <andreev00@gmail.com></source> <context> <name>TextScroller</name> <message> - <location filename="../textscroller.cpp" line="52"/> + <location filename="../textscroller.cpp" line="54"/> <source>Autoscroll Songname</source> <translation>Számok címének görgetése</translation> </message> <message> - <location filename="../textscroller.cpp" line="117"/> + <location filename="../textscroller.cpp" line="55"/> + <source>Transparent Background</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../textscroller.cpp" line="124"/> <source>Buffering: %1%</source> <translation type="unfinished"></translation> </message> diff --git a/src/plugins/Ui/skinned/translations/skinned_plugin_it.ts b/src/plugins/Ui/skinned/translations/skinned_plugin_it.ts index 54e6322d0..fd329927c 100644 --- a/src/plugins/Ui/skinned/translations/skinned_plugin_it.ts +++ b/src/plugins/Ui/skinned/translations/skinned_plugin_it.ts @@ -1267,12 +1267,17 @@ Andrey Adreev <andreev00@gmail.com></source> <context> <name>TextScroller</name> <message> - <location filename="../textscroller.cpp" line="52"/> + <location filename="../textscroller.cpp" line="54"/> <source>Autoscroll Songname</source> <translation>Scorrimento automatico del titolo del brano</translation> </message> <message> - <location filename="../textscroller.cpp" line="117"/> + <location filename="../textscroller.cpp" line="55"/> + <source>Transparent Background</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../textscroller.cpp" line="124"/> <source>Buffering: %1%</source> <translation type="unfinished"></translation> </message> diff --git a/src/plugins/Ui/skinned/translations/skinned_plugin_ja.ts b/src/plugins/Ui/skinned/translations/skinned_plugin_ja.ts index 02dab407f..31c26739d 100644 --- a/src/plugins/Ui/skinned/translations/skinned_plugin_ja.ts +++ b/src/plugins/Ui/skinned/translations/skinned_plugin_ja.ts @@ -1267,12 +1267,17 @@ Andrey Adreev <andreev00@gmail.com></source> <context> <name>TextScroller</name> <message> - <location filename="../textscroller.cpp" line="52"/> + <location filename="../textscroller.cpp" line="54"/> <source>Autoscroll Songname</source> <translation>曲名を自動スクロール</translation> </message> <message> - <location filename="../textscroller.cpp" line="117"/> + <location filename="../textscroller.cpp" line="55"/> + <source>Transparent Background</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../textscroller.cpp" line="124"/> <source>Buffering: %1%</source> <translation>バッファへ先読み: %1%</translation> </message> diff --git a/src/plugins/Ui/skinned/translations/skinned_plugin_lt.ts b/src/plugins/Ui/skinned/translations/skinned_plugin_lt.ts index 32a1053a3..8d62233f0 100644 --- a/src/plugins/Ui/skinned/translations/skinned_plugin_lt.ts +++ b/src/plugins/Ui/skinned/translations/skinned_plugin_lt.ts @@ -1268,12 +1268,17 @@ Andrey Adreev <andreev00@gmail.com></source> <context> <name>TextScroller</name> <message> - <location filename="../textscroller.cpp" line="52"/> + <location filename="../textscroller.cpp" line="54"/> <source>Autoscroll Songname</source> <translation>Automatinis takelio slinkimas</translation> </message> <message> - <location filename="../textscroller.cpp" line="117"/> + <location filename="../textscroller.cpp" line="55"/> + <source>Transparent Background</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../textscroller.cpp" line="124"/> <source>Buffering: %1%</source> <translation>Buferis: %1%</translation> </message> diff --git a/src/plugins/Ui/skinned/translations/skinned_plugin_nl.ts b/src/plugins/Ui/skinned/translations/skinned_plugin_nl.ts index 8ea323241..0c1945731 100644 --- a/src/plugins/Ui/skinned/translations/skinned_plugin_nl.ts +++ b/src/plugins/Ui/skinned/translations/skinned_plugin_nl.ts @@ -1267,12 +1267,17 @@ Andrey Adreev <andreev00@gmail.com></source> <context> <name>TextScroller</name> <message> - <location filename="../textscroller.cpp" line="52"/> + <location filename="../textscroller.cpp" line="54"/> <source>Autoscroll Songname</source> <translation>Automatisch naar Liednummer Scrollen</translation> </message> <message> - <location filename="../textscroller.cpp" line="117"/> + <location filename="../textscroller.cpp" line="55"/> + <source>Transparent Background</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../textscroller.cpp" line="124"/> <source>Buffering: %1%</source> <translation type="unfinished"></translation> </message> diff --git a/src/plugins/Ui/skinned/translations/skinned_plugin_pl_PL.ts b/src/plugins/Ui/skinned/translations/skinned_plugin_pl_PL.ts index 8a7ae5c28..770d4c036 100644 --- a/src/plugins/Ui/skinned/translations/skinned_plugin_pl_PL.ts +++ b/src/plugins/Ui/skinned/translations/skinned_plugin_pl_PL.ts @@ -1267,12 +1267,17 @@ Andrey Adreev <andreev00@gmail.com></source> <context> <name>TextScroller</name> <message> - <location filename="../textscroller.cpp" line="52"/> + <location filename="../textscroller.cpp" line="54"/> <source>Autoscroll Songname</source> <translation>Automatyczne przewijanie tytułu utworu</translation> </message> <message> - <location filename="../textscroller.cpp" line="117"/> + <location filename="../textscroller.cpp" line="55"/> + <source>Transparent Background</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../textscroller.cpp" line="124"/> <source>Buffering: %1%</source> <translation>Buforowanie: : %1%</translation> </message> diff --git a/src/plugins/Ui/skinned/translations/skinned_plugin_pt_BR.ts b/src/plugins/Ui/skinned/translations/skinned_plugin_pt_BR.ts index 0fd240643..90ef3fc98 100644 --- a/src/plugins/Ui/skinned/translations/skinned_plugin_pt_BR.ts +++ b/src/plugins/Ui/skinned/translations/skinned_plugin_pt_BR.ts @@ -1267,12 +1267,17 @@ Andrey Adreev <andreev00@gmail.com></source> <context> <name>TextScroller</name> <message> - <location filename="../textscroller.cpp" line="52"/> + <location filename="../textscroller.cpp" line="54"/> <source>Autoscroll Songname</source> <translation type="unfinished"></translation> </message> <message> - <location filename="../textscroller.cpp" line="117"/> + <location filename="../textscroller.cpp" line="55"/> + <source>Transparent Background</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../textscroller.cpp" line="124"/> <source>Buffering: %1%</source> <translation type="unfinished"></translation> </message> diff --git a/src/plugins/Ui/skinned/translations/skinned_plugin_ru.ts b/src/plugins/Ui/skinned/translations/skinned_plugin_ru.ts index fa316ab0f..cebb328bd 100644 --- a/src/plugins/Ui/skinned/translations/skinned_plugin_ru.ts +++ b/src/plugins/Ui/skinned/translations/skinned_plugin_ru.ts @@ -1270,12 +1270,17 @@ Andrey Adreev <andreev00@gmail.com></source> <context> <name>TextScroller</name> <message> - <location filename="../textscroller.cpp" line="52"/> + <location filename="../textscroller.cpp" line="54"/> <source>Autoscroll Songname</source> <translation>Автопрокрутка названия песни</translation> </message> <message> - <location filename="../textscroller.cpp" line="117"/> + <location filename="../textscroller.cpp" line="55"/> + <source>Transparent Background</source> + <translation>Прозрачный фон</translation> + </message> + <message> + <location filename="../textscroller.cpp" line="124"/> <source>Buffering: %1%</source> <translation>Буферизация: %1%</translation> </message> diff --git a/src/plugins/Ui/skinned/translations/skinned_plugin_sk.ts b/src/plugins/Ui/skinned/translations/skinned_plugin_sk.ts index e353391ae..bb8b8ea19 100644 --- a/src/plugins/Ui/skinned/translations/skinned_plugin_sk.ts +++ b/src/plugins/Ui/skinned/translations/skinned_plugin_sk.ts @@ -1267,12 +1267,17 @@ Andrey Adreev <andreev00@gmail.com></source> <context> <name>TextScroller</name> <message> - <location filename="../textscroller.cpp" line="52"/> + <location filename="../textscroller.cpp" line="54"/> <source>Autoscroll Songname</source> <translation>Automaticky skrolovať názov piesne</translation> </message> <message> - <location filename="../textscroller.cpp" line="117"/> + <location filename="../textscroller.cpp" line="55"/> + <source>Transparent Background</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../textscroller.cpp" line="124"/> <source>Buffering: %1%</source> <translation>Bufferuje sa:%1%</translation> </message> diff --git a/src/plugins/Ui/skinned/translations/skinned_plugin_tr.ts b/src/plugins/Ui/skinned/translations/skinned_plugin_tr.ts index 36349dd70..904eba25f 100644 --- a/src/plugins/Ui/skinned/translations/skinned_plugin_tr.ts +++ b/src/plugins/Ui/skinned/translations/skinned_plugin_tr.ts @@ -1267,12 +1267,17 @@ Andrey Adreev <andreev00@gmail.com></source> <context> <name>TextScroller</name> <message> - <location filename="../textscroller.cpp" line="52"/> + <location filename="../textscroller.cpp" line="54"/> <source>Autoscroll Songname</source> <translation>Şarkı Adını Otomatik Kaydır</translation> </message> <message> - <location filename="../textscroller.cpp" line="117"/> + <location filename="../textscroller.cpp" line="55"/> + <source>Transparent Background</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../textscroller.cpp" line="124"/> <source>Buffering: %1%</source> <translation type="unfinished"></translation> </message> diff --git a/src/plugins/Ui/skinned/translations/skinned_plugin_uk_UA.ts b/src/plugins/Ui/skinned/translations/skinned_plugin_uk_UA.ts index 0603f6693..d0fffc204 100644 --- a/src/plugins/Ui/skinned/translations/skinned_plugin_uk_UA.ts +++ b/src/plugins/Ui/skinned/translations/skinned_plugin_uk_UA.ts @@ -1270,12 +1270,17 @@ Andrey Adreev <andreev00@gmail.com></source> <context> <name>TextScroller</name> <message> - <location filename="../textscroller.cpp" line="52"/> + <location filename="../textscroller.cpp" line="54"/> <source>Autoscroll Songname</source> <translation>Автопрокрутка назви пісні</translation> </message> <message> - <location filename="../textscroller.cpp" line="117"/> + <location filename="../textscroller.cpp" line="55"/> + <source>Transparent Background</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../textscroller.cpp" line="124"/> <source>Buffering: %1%</source> <translation>Буферизація: %1%</translation> </message> diff --git a/src/plugins/Ui/skinned/translations/skinned_plugin_zh_CN.ts b/src/plugins/Ui/skinned/translations/skinned_plugin_zh_CN.ts index 8c37af00f..c594d962d 100644 --- a/src/plugins/Ui/skinned/translations/skinned_plugin_zh_CN.ts +++ b/src/plugins/Ui/skinned/translations/skinned_plugin_zh_CN.ts @@ -1267,12 +1267,17 @@ Andrey Adreev <andreev00@gmail.com></source> <context> <name>TextScroller</name> <message> - <location filename="../textscroller.cpp" line="52"/> + <location filename="../textscroller.cpp" line="54"/> <source>Autoscroll Songname</source> <translation>自动滚动曲目名</translation> </message> <message> - <location filename="../textscroller.cpp" line="117"/> + <location filename="../textscroller.cpp" line="55"/> + <source>Transparent Background</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../textscroller.cpp" line="124"/> <source>Buffering: %1%</source> <translation type="unfinished"></translation> </message> diff --git a/src/plugins/Ui/skinned/translations/skinned_plugin_zh_TW.ts b/src/plugins/Ui/skinned/translations/skinned_plugin_zh_TW.ts index 112b1d0b1..ca2ef8089 100644 --- a/src/plugins/Ui/skinned/translations/skinned_plugin_zh_TW.ts +++ b/src/plugins/Ui/skinned/translations/skinned_plugin_zh_TW.ts @@ -1267,12 +1267,17 @@ Andrey Adreev <andreev00@gmail.com></source> <context> <name>TextScroller</name> <message> - <location filename="../textscroller.cpp" line="52"/> + <location filename="../textscroller.cpp" line="54"/> <source>Autoscroll Songname</source> <translation>自動捲動曲目名</translation> </message> <message> - <location filename="../textscroller.cpp" line="117"/> + <location filename="../textscroller.cpp" line="55"/> + <source>Transparent Background</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../textscroller.cpp" line="124"/> <source>Buffering: %1%</source> <translation type="unfinished"></translation> </message> |
