aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2021-03-30 18:46:21 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2021-03-30 18:46:21 +0000
commit9897db3be447ce31aba9d20edf2ab949eb7590a4 (patch)
tree0373c9607115743813d92ffcbadf98accae69898
parent7dabfaefa6c405e2aaa4804168486abd31a976dd (diff)
downloadqmmp-9897db3be447ce31aba9d20edf2ab949eb7590a4.tar.gz
qmmp-9897db3be447ce31aba9d20edf2ab949eb7590a4.tar.bz2
qmmp-9897db3be447ce31aba9d20edf2ab949eb7590a4.zip
skinned: added 'show tab bar' action
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@9796 90c681e8-e032-0410-971d-27865f9a5e38
-rw-r--r--src/plugins/Ui/skinned/actionmanager.cpp5
-rw-r--r--src/plugins/Ui/skinned/actionmanager.h1
-rw-r--r--src/plugins/Ui/skinned/forms/hotkeyeditor.ui3
-rw-r--r--src/plugins/Ui/skinned/forms/skinnedsettings.ui39
-rw-r--r--src/plugins/Ui/skinned/hotkeyeditor.cpp3
-rw-r--r--src/plugins/Ui/skinned/mainwindow.cpp1
-rw-r--r--src/plugins/Ui/skinned/playlist.cpp21
-rw-r--r--src/plugins/Ui/skinned/playlist.h160
-rw-r--r--src/plugins/Ui/skinned/skinnedsettings.cpp2
9 files changed, 101 insertions, 134 deletions
diff --git a/src/plugins/Ui/skinned/actionmanager.cpp b/src/plugins/Ui/skinned/actionmanager.cpp
index c04f7659c..452e4010e 100644
--- a/src/plugins/Ui/skinned/actionmanager.cpp
+++ b/src/plugins/Ui/skinned/actionmanager.cpp
@@ -83,9 +83,10 @@ ActionManager::ActionManager(QObject *parent) :
{ PL_RENAME, createAction(tr("&Rename List"), "pl_rename", tr("F2")) },
{ PL_SELECT_NEXT, createAction(tr("&Select Next Playlist"), "next_pl", tr("Ctrl+PgDown"), "go-next") },
{ PL_SELECT_PREVIOUS, createAction(tr("&Select Previous Playlist"), "prev_pl", tr("Ctrl+PgUp"), "go-previous") },
- { PL_SHOW_MANAGER, createAction(tr("&Show Playlists"), "show_playlists", tr("P"), "view-list-details") },
+ { PL_SHOW_MANAGER, createAction(tr("&Show Playlists"), "show_pl_manager", tr("P"), "view-list-details") },
{ PL_GROUP_TRACKS, createAction2(tr("&Group Tracks"), "group_tracks", tr("Ctrl+G")) },
{ PL_SHOW_HEADER, createAction2(tr("&Show Column Headers"), "show_header", tr("Ctrl+H")) },
+ { PL_SHOW_TABBAR, createAction2(tr("Show &Tab Bar"), "show_pl_tabbar", tr("Alt+T")) },
//other
{ SETTINGS, createAction(tr("&Settings"), "show_settings", tr("Ctrl+P"), "configure") },
{ ABOUT, createAction(tr("&About"), "about") },
@@ -158,6 +159,7 @@ void ActionManager::readStates()
{
m_settings->beginGroup("Skinned");
m_actions[PL_SHOW_HEADER]->setChecked(m_settings->value("pl_show_header", false).toBool());
+ m_actions[PL_SHOW_TABBAR]->setChecked(m_settings->value("pl_show_tabbar", false).toBool());
m_settings->endGroup();
}
@@ -166,6 +168,7 @@ void ActionManager::saveStates()
QSettings settings(Qmmp::configFile(), QSettings::IniFormat);
settings.beginGroup("Skinned");
settings.setValue("pl_show_header", m_actions[PL_SHOW_HEADER]->isChecked());
+ settings.setValue("pl_show_tabbar", m_actions[PL_SHOW_TABBAR]->isChecked());
settings.endGroup();
}
diff --git a/src/plugins/Ui/skinned/actionmanager.h b/src/plugins/Ui/skinned/actionmanager.h
index 7e0fa7264..37f3f5c5a 100644
--- a/src/plugins/Ui/skinned/actionmanager.h
+++ b/src/plugins/Ui/skinned/actionmanager.h
@@ -95,6 +95,7 @@ public:
PL_SHOW_MANAGER,
PL_GROUP_TRACKS,
PL_SHOW_HEADER,
+ PL_SHOW_TABBAR,
SETTINGS,
ABOUT,
diff --git a/src/plugins/Ui/skinned/forms/hotkeyeditor.ui b/src/plugins/Ui/skinned/forms/hotkeyeditor.ui
index f2d49bd0c..16d2f970d 100644
--- a/src/plugins/Ui/skinned/forms/hotkeyeditor.ui
+++ b/src/plugins/Ui/skinned/forms/hotkeyeditor.ui
@@ -32,6 +32,9 @@
<property name="text">
<string>Change shortcut...</string>
</property>
+ <property name="icon">
+ <iconset theme="configure"/>
+ </property>
</widget>
</item>
<item row="1" column="2">
diff --git a/src/plugins/Ui/skinned/forms/skinnedsettings.ui b/src/plugins/Ui/skinned/forms/skinnedsettings.ui
index 5d180f667..f36b68586 100644
--- a/src/plugins/Ui/skinned/forms/skinnedsettings.ui
+++ b/src/plugins/Ui/skinned/forms/skinnedsettings.ui
@@ -303,13 +303,6 @@
</widget>
</item>
<item>
- <widget class="QCheckBox" name="playlistsCheckBox">
- <property name="text">
- <string>Show playlists</string>
- </property>
- </widget>
- </item>
- <item>
<widget class="QCheckBox" name="showSplittersCheckBox">
<property name="text">
<string>Show splitters</string>
@@ -1153,38 +1146,6 @@
</hints>
</connection>
<connection>
- <sender>playlistsCheckBox</sender>
- <signal>toggled(bool)</signal>
- <receiver>plSeplineEdit</receiver>
- <slot>setEnabled(bool)</slot>
- <hints>
- <hint type="sourcelabel">
- <x>211</x>
- <y>246</y>
- </hint>
- <hint type="destinationlabel">
- <x>263</x>
- <y>369</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>playlistsCheckBox</sender>
- <signal>toggled(bool)</signal>
- <receiver>showNewPLCheckBox</receiver>
- <slot>setEnabled(bool)</slot>
- <hints>
- <hint type="sourcelabel">
- <x>105</x>
- <y>246</y>
- </hint>
- <hint type="destinationlabel">
- <x>105</x>
- <y>330</y>
- </hint>
- </hints>
- </connection>
- <connection>
<sender>plSkinColorsCheckBox</sender>
<signal>toggled(bool)</signal>
<receiver>widget_2</receiver>
diff --git a/src/plugins/Ui/skinned/hotkeyeditor.cpp b/src/plugins/Ui/skinned/hotkeyeditor.cpp
index a02ca48c7..1c719f4d2 100644
--- a/src/plugins/Ui/skinned/hotkeyeditor.cpp
+++ b/src/plugins/Ui/skinned/hotkeyeditor.cpp
@@ -30,7 +30,6 @@ HotkeyEditor::HotkeyEditor(QWidget *parent) : QWidget(parent), m_ui(new Ui::Hotk
{
m_ui->setupUi(this);
loadShortcuts();
- m_ui->changeShortcutButton->setIcon(QIcon::fromTheme("configure"));
}
HotkeyEditor::~HotkeyEditor()
@@ -74,7 +73,7 @@ void HotkeyEditor::loadShortcuts()
m_ui->shortcutTreeWidget->addTopLevelItem(item);
//playlist
item = new QTreeWidgetItem (m_ui->shortcutTreeWidget, QStringList() << tr("Playlist"));
- for(int i = ActionManager::PL_ADD_FILE; i <= ActionManager::PL_SHOW_HEADER; ++i)
+ for(int i = ActionManager::PL_ADD_FILE; i <= ActionManager::PL_SHOW_TABBAR; ++i)
new ShortcutItem(item, i);
item->setExpanded(true);
m_ui->shortcutTreeWidget->addTopLevelItem(item);
diff --git a/src/plugins/Ui/skinned/mainwindow.cpp b/src/plugins/Ui/skinned/mainwindow.cpp
index d52da19f1..94afe4f77 100644
--- a/src/plugins/Ui/skinned/mainwindow.cpp
+++ b/src/plugins/Ui/skinned/mainwindow.cpp
@@ -449,6 +449,7 @@ void MainWindow::createActions()
plMenu->addAction(SET_ACTION(ActionManager::CLEAR_QUEUE, m_pl_manager, SLOT(clearQueue())));
plMenu->addSeparator();
plMenu->addAction(ACTION(ActionManager::PL_SHOW_HEADER));
+ plMenu->addAction(ACTION(ActionManager::PL_SHOW_TABBAR));
plMenu->addAction(ACTION(ActionManager::PL_GROUP_TRACKS));
connect(m_ui_settings, SIGNAL(repeatableListChanged(bool)),
diff --git a/src/plugins/Ui/skinned/playlist.cpp b/src/plugins/Ui/skinned/playlist.cpp
index 19c8e7835..2a7fe390c 100644
--- a/src/plugins/Ui/skinned/playlist.cpp
+++ b/src/plugins/Ui/skinned/playlist.cpp
@@ -153,7 +153,7 @@ void PlayList::updatePositions()
{
int sx = (width()-275*m_ratio)/25;
int sy = (height()-116*m_ratio)/29;
- if (sx < 0 || sy < 0 || m_shaded) //skip shaded mode
+ if(sx < 0 || sy < 0 || m_shaded) //skip shaded mode
return;
m_titleBar->resize (275*m_ratio+25*sx, 20*m_ratio);
@@ -341,11 +341,12 @@ void PlayList::createActions()
//actions
SET_ACTION(ActionManager::PL_GROUP_TRACKS, m_ui_settings, SLOT(setGroupsEnabled(bool)));
ACTION(ActionManager::PL_GROUP_TRACKS)->setChecked(m_ui_settings->isGroupsEnabled());
+ SET_ACTION(ActionManager::PL_SHOW_TABBAR, this, SLOT(readSettings()));
}
void PlayList::closeEvent (QCloseEvent *e)
{
- if (e->spontaneous ())
+ if(e->spontaneous ())
parentWidget()->close();
}
@@ -383,7 +384,7 @@ void PlayList::resizeEvent (QResizeEvent *)
void PlayList::mousePressEvent (QMouseEvent *e)
{
Q_UNUSED(e);
- if (m_resizeWidget->underMouse())
+ if(m_resizeWidget->underMouse())
{
m_resize = true;
setCursor (m_skin->getCursor (Skin::CUR_PSIZE));
@@ -394,7 +395,7 @@ void PlayList::mousePressEvent (QMouseEvent *e)
void PlayList::mouseMoveEvent (QMouseEvent *e)
{
- if (m_resize)
+ if(m_resize)
{
int dx = m_ratio * 25;
int dy = m_ratio * 29;
@@ -424,7 +425,7 @@ void PlayList::mouseMoveEvent (QMouseEvent *e)
void PlayList::mouseReleaseEvent (QMouseEvent *)
{
setCursor (m_skin->getCursor (Skin::CUR_PNORMAL));
- /*if (m_resize)
+ /*if(m_resize)
m_listWidget->updateList();*/
m_resize = false;
Dock::instance()->updateDock();
@@ -432,7 +433,7 @@ void PlayList::mouseReleaseEvent (QMouseEvent *)
void PlayList::changeEvent (QEvent * event)
{
- if (event->type() == QEvent::ActivationChange)
+ if(event->type() == QEvent::ActivationChange)
{
m_titleBar->setActive (isActiveWindow());
}
@@ -440,8 +441,7 @@ void PlayList::changeEvent (QEvent * event)
void PlayList::readSettings()
{
- QSettings settings (Qmmp::configFile(), QSettings::IniFormat);
- if (settings.value("Skinned/pl_show_plalists", false).toBool())
+ if(ACTION(ActionManager::PL_SHOW_TABBAR)->isChecked())
{
if(!m_pl_selector)
m_pl_selector = new PlayListSelector(m_pl_manager, this);
@@ -458,7 +458,7 @@ void PlayList::readSettings()
m_pl_selector = nullptr;
}
- if (m_update)
+ if(m_update)
{
m_listWidget->readSettings();
m_titleBar->readSettings();
@@ -470,6 +470,7 @@ void PlayList::readSettings()
{
QScreen *primaryScreen = QGuiApplication::primaryScreen();
QRect availableGeometry = primaryScreen->availableGeometry();
+ QSettings settings (Qmmp::configFile(), QSettings::IniFormat);
QPoint pos = settings.value ("Skinned/pl_pos", QPoint (100, 332)).toPoint();
m_ratio = m_skin->ratio();
//TODO QGuiApplication::screenAt
@@ -540,7 +541,7 @@ QString PlayList::formatTime (int sec)
void PlayList::setTime(qint64 time)
{
- if (time < 0)
+ if(time < 0)
m_current_time->display("--:--");
else
m_current_time->display(formatTime (time/1000));
diff --git a/src/plugins/Ui/skinned/playlist.h b/src/plugins/Ui/skinned/playlist.h
index 78fd7a3ae..76ee7552e 100644
--- a/src/plugins/Ui/skinned/playlist.h
+++ b/src/plugins/Ui/skinned/playlist.h
@@ -47,97 +47,97 @@ class QmmpUiSettings;
*/
class PlayList : public QWidget
{
- Q_OBJECT
- public:
- explicit PlayList(PlayListManager *manager, QWidget *parent = nullptr);
- virtual ~PlayList();
+ Q_OBJECT
+public:
+ explicit PlayList(PlayListManager *manager, QWidget *parent = nullptr);
+ virtual ~PlayList();
- void readSettings();
- void setMinimalMode(bool b = true);
- void writeSettings();
+ void setMinimalMode(bool b = true);
+ void writeSettings();
#ifdef QMMP_WS_X11
- bool useCompiz() const;
+ bool useCompiz() const;
#endif
- signals:
- void play();
- void next();
- void prev();
- void pause();
- void stop();
- void eject();
- void loadPlaylist();
- void savePlaylist();
- void closed();
+signals:
+ void play();
+ void next();
+ void prev();
+ void pause();
+ void stop();
+ void eject();
+ void loadPlaylist();
+ void savePlaylist();
+ void closed();
- public slots:
- void setTime(qint64 time);
+public slots:
+ void setTime(qint64 time);
+ void readSettings();
- private slots:
- void showAddMenu();
- void showSubMenu();
- void showSelectMenu();
- void showSortMenu();
- void showPlaylistMenu();
- void updateSkin();
- void deletePlaylist();
- void renamePlaylist();
- void showPlayLists();
- void generateCopySelectedMenu();
- void copySelectedMenuActionTriggered(QAction *action);
- void onCurrentPlayListChanged(PlayListModel *current, PlayListModel *previous);
- void onListChanged(int flags);
+private slots:
+ void showAddMenu();
+ void showSubMenu();
+ void showSelectMenu();
+ void showSortMenu();
+ void showPlaylistMenu();
+ void updateSkin();
+ void deletePlaylist();
+ void renamePlaylist();
+ void showPlayLists();
+ void generateCopySelectedMenu();
+ void copySelectedMenuActionTriggered(QAction *action);
+ void onCurrentPlayListChanged(PlayListModel *current, PlayListModel *previous);
+ void onListChanged(int flags);
- private:
- void updatePositions();
- QString formatTime (int sec);
- void drawPixmap (QPainter *painter, int x, int y, const QPixmap &pix);
- void createMenus();
- void createActions();
- //events
- void paintEvent (QPaintEvent *) override;
- void resizeEvent (QResizeEvent *) override;
- void mouseMoveEvent (QMouseEvent *) override;
- void mousePressEvent (QMouseEvent *) override;
- void mouseReleaseEvent (QMouseEvent *) override;
- void changeEvent (QEvent*) override;
- void closeEvent (QCloseEvent*) override;
- void keyPressEvent (QKeyEvent*) override;
+private:
+ void updatePositions();
+ QString formatTime (int sec);
+ void drawPixmap (QPainter *painter, int x, int y, const QPixmap &pix);
+ void createMenus();
+ void createActions();
+ //events
+ void paintEvent (QPaintEvent *) override;
+ void resizeEvent (QResizeEvent *) override;
+ void mouseMoveEvent (QMouseEvent *) override;
+ void mousePressEvent (QMouseEvent *) override;
+ void mouseReleaseEvent (QMouseEvent *) override;
+ void changeEvent (QEvent*) override;
+ void closeEvent (QCloseEvent*) override;
+ void keyPressEvent (QKeyEvent*) override;
#ifdef QMMP_WS_X11
- bool event (QEvent *event) override;
+ bool event (QEvent *event) override;
#endif
- QMenu *m_addMenu;
- QMenu *m_subMenu;
- QMenu *m_selectMenu;
- QMenu *m_sortMenu;
- QMenu *m_playlistMenu;
- QMenu *m_copySelectedMenu;
- QWidget *m_resizeWidget;
- Button *m_buttonAdd;
- Button *m_buttonSub;
- Button *m_selectButton;
- Button *m_sortButton;
- Button* m_playlistButton;
- PlaylistControl* m_pl_control;
- SymbolDisplay* m_length_totalLength;
- SymbolDisplay* m_current_time;
- Skin *m_skin;
- ListWidget *m_listWidget;
- PlayListTitleBar *m_titleBar;
- PlayListSlider *m_plslider;
- bool m_resize = false;
- bool m_update = false;
- int m_ratio;
- int m_height;
- bool m_shaded = false;
- PlayListManager *m_pl_manager;
- QmmpUiSettings *m_ui_settings;
- KeyboardManager* m_keyboardManager;
- QPointer <PlayListBrowser> m_pl_browser;
- PlayListSelector *m_pl_selector = nullptr;
+ QMenu *m_addMenu;
+ QMenu *m_subMenu;
+ QMenu *m_selectMenu;
+ QMenu *m_sortMenu;
+ QMenu *m_playlistMenu;
+ QMenu *m_copySelectedMenu;
+ QWidget *m_resizeWidget;
+ Button *m_buttonAdd;
+ Button *m_buttonSub;
+ Button *m_selectButton;
+ Button *m_sortButton;
+ Button* m_playlistButton;
+ PlaylistControl* m_pl_control;
+ SymbolDisplay* m_length_totalLength;
+ SymbolDisplay* m_current_time;
+ Skin *m_skin;
+ ListWidget *m_listWidget;
+ PlayListTitleBar *m_titleBar;
+ PlayListSlider *m_plslider;
+ bool m_resize = false;
+ bool m_update = false;
+ int m_ratio;
+ int m_height;
+ bool m_shaded = false;
+ PlayListManager *m_pl_manager;
+ QmmpUiSettings *m_ui_settings;
+ KeyboardManager* m_keyboardManager;
+ QPointer <PlayListBrowser> m_pl_browser;
+ PlayListSelector *m_pl_selector = nullptr;
#ifdef QMMP_WS_X11
- bool m_compiz;
+ bool m_compiz;
#endif
};
diff --git a/src/plugins/Ui/skinned/skinnedsettings.cpp b/src/plugins/Ui/skinned/skinnedsettings.cpp
index 0d0149ebf..669f195a7 100644
--- a/src/plugins/Ui/skinned/skinnedsettings.cpp
+++ b/src/plugins/Ui/skinned/skinnedsettings.cpp
@@ -242,7 +242,6 @@ void SkinnedSettings::readSettings()
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.showSplittersCheckBox->setChecked(settings.value("pl_show_splitters", true).toBool());
m_ui.alternateSplitterColorCheckBox->setChecked(settings.value("pl_alt_splitter_color", false).toBool());
m_ui.popupCheckBox->setChecked(settings.value("pl_show_popup", false).toBool());
@@ -284,7 +283,6 @@ void SkinnedSettings::writeSettings()
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());
settings.setValue("pl_show_splitters", m_ui.showSplittersCheckBox->isChecked());
settings.setValue("pl_alt_splitter_color", m_ui.alternateSplitterColorCheckBox->isChecked());
settings.setValue("pl_show_popup", m_ui.popupCheckBox->isChecked());