From d63bf406c2c5933c05e745623113eeb799241285 Mon Sep 17 00:00:00 2001 From: Flavio Tordini Date: Wed, 24 Jun 2009 09:59:22 +0200 Subject: [PATCH] Unified toolbar on Mac --- src/MainWindow.cpp | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 9d2b618..1f9ed55 100755 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -262,19 +262,15 @@ void MainWindow::createToolBars() { seekSlider = new Phonon::SeekSlider(this); seekSlider->setIconVisible(false); - // seekSlider->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - mainToolBar->addWidget(new Spacer(mainToolBar, seekSlider)); + Spacer *seekSliderSpacer = new Spacer(mainToolBar, seekSlider); + seekSliderSpacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + mainToolBar->addWidget(seekSliderSpacer); volumeSlider = new Phonon::VolumeSlider(this); - // this makes the volume slider smaller... - volumeSlider->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum); + // this makes the volume slider smaller + volumeSlider->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); mainToolBar->addWidget(new Spacer(mainToolBar, volumeSlider)); - // mainToolBar->addSeparator(); - // mainToolBar->addAction(downloadAct); - // mainToolBar->addAction(webPageAct); - - // toolbarSearch->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum); mainToolBar->addWidget(new Spacer(mainToolBar, toolbarSearch)); addToolBar(mainToolBar); @@ -282,8 +278,6 @@ void MainWindow::createToolBars() { void MainWindow::createStatusBar() { statusBar()->show(); - statusBar()->setBackgroundRole(QPalette::Dark); - // statusBar()->setAutoFillBackground(true); } void MainWindow::readSettings() { @@ -325,17 +319,16 @@ void MainWindow::showWidget ( QWidget* widget ) { } // backAct->setEnabled(history->size() > 1); + // settingsAct->setEnabled(widget != settingsView); stopAct->setEnabled(widget == mediaView); fullscreenAct->setEnabled(widget == mediaView); webPageAct->setEnabled(widget == mediaView); - // settingsAct->setEnabled(widget != settingsView); aboutAct->setEnabled(widget != aboutView); - // toolbar only for the mediaView - // This is cool on the Mac - // But does not respect layouts, maybe it's a Qt bug - // setUnifiedTitleAndToolBarOnMac(widget == mediaView); + // cool toolbar on the Mac + setUnifiedTitleAndToolBarOnMac(widget == mediaView); + // toolbar only for the mediaView mainToolBar->setVisible(widget == mediaView); history->push(widget); -- 2.39.5