Replace the dock widgets with a tab widget to remove the (mostly) superfluous label at the top.

Update issue #389
Status: Fixed
It looked like it was going to be too difficult to make the tabs themselves draggable - the draggable dock widgets are actually a Qt thing and they're not very customisable.  So instead I've just removed the top label all together.
This commit is contained in:
David Sansome 2010-06-12 19:32:17 +00:00
parent a41a450218
commit e419e27644
28 changed files with 378 additions and 371 deletions

View File

@ -1248,10 +1248,10 @@ msgstr ""
msgid "Library"
msgstr ""
msgid "Internet"
msgid "Files"
msgstr ""
msgid "Files"
msgid "Internet"
msgstr ""
msgid "Music"

View File

@ -1252,12 +1252,12 @@ msgstr ""
msgid "Library"
msgstr "Knihovna"
msgid "Internet"
msgstr "Internet"
msgid "Files"
msgstr "Soubory"
msgid "Internet"
msgstr "Internet"
msgid "Music"
msgstr "Hudba"

View File

@ -1255,12 +1255,12 @@ msgstr ""
msgid "Library"
msgstr "Bibliotek"
msgid "Internet"
msgstr ""
msgid "Files"
msgstr "Filer"
msgid "Internet"
msgstr ""
msgid "Music"
msgstr "Musik"

View File

@ -1254,12 +1254,12 @@ msgstr ""
msgid "Library"
msgstr "Musiksammlung"
msgid "Internet"
msgstr "Internet"
msgid "Files"
msgstr "Dateien"
msgid "Internet"
msgstr "Internet"
msgid "Music"
msgstr "Musik"

View File

@ -1258,12 +1258,12 @@ msgstr ""
msgid "Library"
msgstr "Βιβλιοθήκη"
msgid "Internet"
msgstr "Διαδίκτυο"
msgid "Files"
msgstr "Αρχεία"
msgid "Internet"
msgstr "Διαδίκτυο"
msgid "Music"
msgstr "Μουσική"

View File

@ -1253,12 +1253,12 @@ msgstr ""
msgid "Library"
msgstr "Library"
msgid "Internet"
msgstr "Internet"
msgid "Files"
msgstr "Files"
msgid "Internet"
msgstr "Internet"
msgid "Music"
msgstr "Music"

View File

@ -1250,12 +1250,12 @@ msgstr ""
msgid "Library"
msgstr "Library"
msgid "Internet"
msgstr ""
msgid "Files"
msgstr "Files"
msgid "Internet"
msgstr ""
msgid "Music"
msgstr "Music"

View File

@ -1262,12 +1262,12 @@ msgstr ""
msgid "Library"
msgstr "Colección"
msgid "Internet"
msgstr "Internet"
msgid "Files"
msgstr "Archivos"
msgid "Internet"
msgstr "Internet"
msgid "Music"
msgstr "Música"

View File

@ -1248,10 +1248,10 @@ msgstr ""
msgid "Library"
msgstr ""
msgid "Internet"
msgid "Files"
msgstr ""
msgid "Files"
msgid "Internet"
msgstr ""
msgid "Music"

View File

@ -1258,12 +1258,12 @@ msgstr ""
msgid "Library"
msgstr "Bibliothèque"
msgid "Internet"
msgstr ""
msgid "Files"
msgstr "Fichiers"
msgid "Internet"
msgstr ""
msgid "Music"
msgstr "Musique"

View File

@ -1250,10 +1250,10 @@ msgstr ""
msgid "Library"
msgstr ""
msgid "Internet"
msgid "Files"
msgstr ""
msgid "Files"
msgid "Internet"
msgstr ""
msgid "Music"

View File

@ -1259,12 +1259,12 @@ msgstr ""
msgid "Library"
msgstr "Raccolta"
msgid "Internet"
msgstr "Internet"
msgid "Files"
msgstr "File"
msgid "Internet"
msgstr "Internet"
msgid "Music"
msgstr "Musica"

View File

@ -1250,10 +1250,10 @@ msgstr ""
msgid "Library"
msgstr ""
msgid "Internet"
msgid "Files"
msgstr ""
msgid "Files"
msgid "Internet"
msgstr ""
msgid "Music"

View File

@ -1252,12 +1252,12 @@ msgstr ""
msgid "Library"
msgstr "Bibliotek"
msgid "Internet"
msgstr ""
msgid "Files"
msgstr "Filer"
msgid "Internet"
msgstr ""
msgid "Music"
msgstr "Musikk"

View File

@ -1248,12 +1248,12 @@ msgstr ""
msgid "Library"
msgstr "Bibliotèca"
msgid "Internet"
msgstr "Sus Internet"
msgid "Files"
msgstr "Fichièrs"
msgid "Internet"
msgstr "Sus Internet"
msgid "Music"
msgstr "Musica"

View File

@ -1250,12 +1250,12 @@ msgstr ""
msgid "Library"
msgstr "Biblioteka"
msgid "Internet"
msgstr ""
msgid "Files"
msgstr "Pliki"
msgid "Internet"
msgstr ""
msgid "Music"
msgstr "Muzyka"

View File

@ -1254,12 +1254,12 @@ msgstr ""
msgid "Library"
msgstr "Biblioteca"
msgid "Internet"
msgstr "Internet"
msgid "Files"
msgstr "Ficheiros"
msgid "Internet"
msgstr "Internet"
msgid "Music"
msgstr "Música"

View File

@ -1258,12 +1258,12 @@ msgstr ""
msgid "Library"
msgstr "Biblioteca"
msgid "Internet"
msgstr "Internet"
msgid "Files"
msgstr "Arquivos"
msgid "Internet"
msgstr "Internet"
msgid "Music"
msgstr "Música"

View File

@ -1249,12 +1249,12 @@ msgstr ""
msgid "Library"
msgstr "Bibliotecă"
msgid "Internet"
msgstr ""
msgid "Files"
msgstr "Fișiere"
msgid "Internet"
msgstr ""
msgid "Music"
msgstr "Muzică"

View File

@ -1254,12 +1254,12 @@ msgstr ""
msgid "Library"
msgstr "Коллекция"
msgid "Internet"
msgstr "Интернет"
msgid "Files"
msgstr "Файлы"
msgid "Internet"
msgstr "Интернет"
msgid "Music"
msgstr "Музыка"

View File

@ -1255,12 +1255,12 @@ msgstr ""
msgid "Library"
msgstr "Zbierka"
msgid "Internet"
msgstr "Internet"
msgid "Files"
msgstr "Súbory"
msgid "Internet"
msgstr "Internet"
msgid "Music"
msgstr "Hudba"

View File

@ -1255,12 +1255,12 @@ msgstr ""
msgid "Library"
msgstr "Bibliotek"
msgid "Internet"
msgstr "Internet"
msgid "Files"
msgstr "Filer"
msgid "Internet"
msgstr "Internet"
msgid "Music"
msgstr "Musik"

View File

@ -1248,12 +1248,12 @@ msgstr ""
msgid "Library"
msgstr "Kütüphane"
msgid "Internet"
msgstr "İnternet"
msgid "Files"
msgstr "Dosyalar"
msgid "Internet"
msgstr "İnternet"
msgid "Music"
msgstr "Müzik"

View File

@ -1248,10 +1248,10 @@ msgstr ""
msgid "Library"
msgstr ""
msgid "Internet"
msgid "Files"
msgstr ""
msgid "Files"
msgid "Internet"
msgstr ""
msgid "Music"

View File

@ -1248,10 +1248,10 @@ msgstr ""
msgid "Library"
msgstr ""
msgid "Internet"
msgid "Files"
msgstr ""
msgid "Files"
msgid "Internet"
msgstr ""
msgid "Music"

View File

@ -86,7 +86,6 @@ using boost::scoped_ptr;
void qt_mac_set_dock_menu(QMenu*);
#endif
const int MainWindow::kStateVersion = 1;
const char* MainWindow::kSettingsGroup = "MainWindow";
const char* MainWindow::kMusicFilterSpec =
QT_TR_NOOP("Music (*.mp3 *.ogg *.flac *.mpc *.m4a *.aac *.wma)");
@ -464,11 +463,10 @@ MainWindow::MainWindow(NetworkAccessManager* network, Engine::Type engine, QWidg
settings_.beginGroup(kSettingsGroup);
restoreGeometry(settings_.value("geometry").toByteArray());
if (!restoreState(settings_.value("state").toByteArray(), kStateVersion)) {
tabifyDockWidget(ui_->files_dock, ui_->radio_dock);
tabifyDockWidget(ui_->files_dock, ui_->library_dock);
if (!ui_->splitter->restoreState(settings_.value("splitter_state").toByteArray())) {
ui_->splitter->setSizes(QList<int>() << 200 << width() - 200);
}
ui_->tabs->setCurrentIndex(settings_.value("current_tab", 0).toInt());
ui_->file_view->SetPath(settings_.value("file_path", QDir::homePath()).toString());
ReloadSettings();
@ -650,7 +648,8 @@ void MainWindow::resizeEvent(QResizeEvent*) {
void MainWindow::SaveGeometry() {
settings_.setValue("geometry", saveGeometry());
settings_.setValue("state", saveState(kStateVersion));
settings_.setValue("splitter_state", ui_->splitter->saveState());
settings_.setValue("current_tab", ui_->tabs->currentIndex());
}
void MainWindow::PlayIndex(const QModelIndex& index) {

View File

@ -156,8 +156,6 @@ class MainWindow : public QMainWindow {
void AddLibrarySongsToPlaylist(bool clear_first, const SongList& songs);
private:
static const int kStateVersion;
Ui_MainWindow* ui_;
SystemTrayIcon* tray_icon_;
OSD* osd_;

View File

@ -18,7 +18,7 @@
<normaloff>:/icon.png</normaloff>:/icon.png</iconset>
</property>
<widget class="QWidget" name="centralWidget">
<layout class="QVBoxLayout" name="verticalLayout_3">
<layout class="QVBoxLayout" name="verticalLayout_8">
<property name="spacing">
<number>0</number>
</property>
@ -26,322 +26,332 @@
<number>0</number>
</property>
<item>
<widget class="PlaylistContainer" name="playlist" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<widget class="QSplitter" name="splitter">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QFrame" name="player_controls">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>1</number>
<widget class="QTabWidget" name="tabs">
<property name="tabPosition">
<enum>QTabWidget::South</enum>
</property>
<property name="margin">
<property name="currentIndex">
<number>0</number>
</property>
<item>
<widget class="QToolButton" name="clear_playlist_button">
<property name="iconSize">
<size>
<width>22</width>
<height>22</height>
</size>
<property name="usesScrollButtons">
<bool>false</bool>
</property>
<property name="documentMode">
<bool>true</bool>
</property>
<property name="tabsClosable">
<bool>false</bool>
</property>
<property name="movable">
<bool>true</bool>
</property>
<widget class="QWidget" name="library_tab">
<attribute name="title">
<string>Library</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3">
<property name="spacing">
<number>0</number>
</property>
<property name="autoRaise">
<bool>true</bool>
<property name="margin">
<number>0</number>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
<item>
<widget class="LibraryFilterWidget" name="library_filter" native="true"/>
</item>
<item>
<widget class="LibraryView" name="library_view">
<property name="dragEnabled">
<bool>true</bool>
</property>
<property name="dragDropMode">
<enum>QAbstractItemView::DragOnly</enum>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::ExtendedSelection</enum>
</property>
<property name="allColumnsShowFocus">
<bool>true</bool>
</property>
<attribute name="headerVisible">
<bool>false</bool>
</attribute>
<attribute name="headerVisible">
<bool>false</bool>
</attribute>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="file_tab">
<attribute name="title">
<string>Files</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_5">
<property name="spacing">
<number>0</number>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="back_button">
<property name="iconSize">
<size>
<width>22</width>
<height>22</height>
</size>
<property name="margin">
<number>0</number>
</property>
<property name="autoRaise">
<bool>true</bool>
<item>
<widget class="FileView" name="file_view" native="true"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="radio_tab">
<attribute name="title">
<string>Internet</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_6">
<property name="spacing">
<number>0</number>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="pause_play_button">
<property name="iconSize">
<size>
<width>22</width>
<height>22</height>
</size>
<property name="margin">
<number>0</number>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="stop_button">
<property name="enabled">
<bool>false</bool>
</property>
<property name="iconSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="popupMode">
<enum>QToolButton::MenuButtonPopup</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="forward_button">
<property name="iconSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QWidget" name="last_fm_controls" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="spacing">
<number>1</number>
<item>
<widget class="RadioViewContainer" name="radio_view" native="true"/>
</item>
</layout>
</widget>
</widget>
<widget class="QWidget" name="">
<layout class="QVBoxLayout" name="verticalLayout_7">
<property name="spacing">
<number>0</number>
</property>
<item>
<widget class="PlaylistContainer" name="playlist" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="margin">
<number>0</number>
</widget>
</item>
<item>
<widget class="QFrame" name="player_controls">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<item>
<widget class="Line" name="lastfm_line">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="love_button">
<property name="iconSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="ban_button">
<property name="iconSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="AnalyzerContainer" name="analyzer" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>100</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>36</height>
</size>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="Line" name="line_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="Amarok::VolumeSlider" name="volume">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
</layout>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>1</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QToolButton" name="clear_playlist_button">
<property name="iconSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="back_button">
<property name="iconSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="pause_play_button">
<property name="iconSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="stop_button">
<property name="enabled">
<bool>false</bool>
</property>
<property name="iconSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="popupMode">
<enum>QToolButton::MenuButtonPopup</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="forward_button">
<property name="iconSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QWidget" name="last_fm_controls" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="spacing">
<number>1</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="Line" name="lastfm_line">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="love_button">
<property name="iconSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="ban_button">
<property name="iconSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="AnalyzerContainer" name="analyzer" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>100</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>36</height>
</size>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="Line" name="line_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="Amarok::VolumeSlider" name="volume">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<widget class="QStatusBar" name="statusBar"/>
<widget class="QDockWidget" name="library_dock">
<property name="features">
<set>QDockWidget::DockWidgetMovable</set>
</property>
<property name="windowTitle">
<string>Library</string>
</property>
<attribute name="dockWidgetArea">
<number>1</number>
</attribute>
<widget class="QWidget" name="dockWidgetContents_2">
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="LibraryFilterWidget" name="library_filter" native="true"/>
</item>
<item>
<widget class="LibraryView" name="library_view">
<property name="dragEnabled">
<bool>true</bool>
</property>
<property name="dragDropMode">
<enum>QAbstractItemView::DragOnly</enum>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::ExtendedSelection</enum>
</property>
<property name="allColumnsShowFocus">
<bool>true</bool>
</property>
<attribute name="headerVisible">
<bool>false</bool>
</attribute>
<attribute name="headerVisible">
<bool>false</bool>
</attribute>
</widget>
</item>
</layout>
</widget>
</widget>
<widget class="QDockWidget" name="radio_dock">
<property name="features">
<set>QDockWidget::DockWidgetMovable</set>
</property>
<property name="windowTitle">
<string>Internet</string>
</property>
<attribute name="dockWidgetArea">
<number>1</number>
</attribute>
<widget class="QWidget" name="dockWidgetContents_5">
<layout class="QVBoxLayout" name="verticalLayout_4">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="RadioViewContainer" name="radio_view" native="true"/>
</item>
</layout>
</widget>
</widget>
<widget class="QDockWidget" name="files_dock">
<property name="features">
<set>QDockWidget::DockWidgetMovable</set>
</property>
<property name="windowTitle">
<string>Files</string>
</property>
<attribute name="dockWidgetArea">
<number>1</number>
</attribute>
<widget class="QWidget" name="dockWidgetContents_6">
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="FileView" name="file_view" native="true"/>
</item>
</layout>
</widget>
</widget>
<widget class="QMenuBar" name="menuBar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>804</width>
<height>23</height>
<height>25</height>
</rect>
</property>
<widget class="QMenu" name="menuMusic">