]> Some of my projects - aniplayer-old.git/commitdiff
- Make all ui elements in the control panel a separate tool bar
authorAPTX <APTX@.(none)>
Sat, 9 May 2009 12:06:10 +0000 (14:06 +0200)
committerAPTX <APTX@.(none)>
Sat, 9 May 2009 12:06:10 +0000 (14:06 +0200)
- The new seekslider is now the default

src/main.cpp
src/menu.cpp
src/menu.ui
src/seekslider.cpp

index 3ba9ec56a782b7d8fdcb97fd2e12868579316467..da1ef453fb2ad1dd7e053e967f0ea999e6654608 100644 (file)
@@ -32,6 +32,7 @@ int main(int argc, char *argv[])
        {
                w.play(QDir::fromNativeSeparators(a.arguments()[1]), true);
        }
+
        return a.exec();
 }
 #else
index e231089adcaea2a1c28fd55f42c3cf17ff0009ab..d07cd0209cf3dc59904a19a57c3cf1ae637167ab 100644 (file)
@@ -35,23 +35,37 @@ Menu::Menu(QWidget *parent)
                layout->addWidget(m_seekSlider);
                ui->seekBar->addWidget(seekBarContents);
        }
+       {
+               QWidget *timeBarContents = new QWidget(ui->timeBar);
+               timeLabel = new QLabel("0:00:00 / 0:00:00", timeBarContents);
+
+               QHBoxLayout *layout = new QHBoxLayout(timeBarContents);
+               layout->addWidget(timeLabel);
+               ui->timeBar->addWidget(timeBarContents);
+       }
+       {
+               QWidget *volumeBarContents = new QWidget(ui->timeBar);
+               m_volumeSlider = new Phonon::VolumeSlider(volumeBarContents);
+               m_volumeSlider->setMinimumWidth(50);
+
+               QHBoxLayout *layout = new QHBoxLayout(volumeBarContents);
+               layout->addWidget(m_volumeSlider);
+               ui->volumeBar->addWidget(volumeBarContents);
+       }
+
        {
                QWidget *playBarContents = new QWidget(ui->playBar);
 
                m_oldSeekSlider = new Phonon::SeekSlider(playBarContents);
-               m_volumeSlider = new Phonon::VolumeSlider(playBarContents);
-
                m_oldSeekSlider->setMinimumWidth(100);
-               m_volumeSlider->setMinimumWidth(50);
-
-               timeLabel = new QLabel("0:00:00 / 0:00:00", this);
 
                QHBoxLayout *layout = new QHBoxLayout(playBarContents);
                layout->addWidget(m_oldSeekSlider, 5);
-               layout->addWidget(timeLabel, 1);
-               layout->addWidget(m_volumeSlider, 2);
+//             layout->addWidget(timeLabel, 1);
+//             layout->addWidget(m_volumeSlider, 2);
                ui->playBar->addWidget(playBarContents);
        }
+
        setWindowTitle(tr("%1 Control Panel").arg(qApp->applicationName()));
 
        totalTime = " / " + QTime(0, 0, 0, 0).toString("h:mm:ss");
index 46919ddd2e408fea298a6e96705519680b26e9e3..14747d0f3b004cb74d0ebaef23bd4bd534bf6346 100644 (file)
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>395</width>
-    <height>77</height>
+    <height>79</height>
    </rect>
   </property>
   <property name="minimumSize">
     <bool>true</bool>
    </attribute>
   </widget>
+  <widget class="QToolBar" name="timeBar">
+   <property name="windowTitle">
+    <string>Time</string>
+   </property>
+   <attribute name="toolBarArea">
+    <enum>TopToolBarArea</enum>
+   </attribute>
+   <attribute name="toolBarBreak">
+    <bool>false</bool>
+   </attribute>
+  </widget>
+  <widget class="QToolBar" name="volumeBar">
+   <property name="windowTitle">
+    <string>Volume</string>
+   </property>
+   <attribute name="toolBarArea">
+    <enum>TopToolBarArea</enum>
+   </attribute>
+   <attribute name="toolBarBreak">
+    <bool>false</bool>
+   </attribute>
+  </widget>
  </widget>
  <layoutdefault spacing="6" margin="11"/>
  <resources/>
index ca43e605bc6980e8e918a3667885465039e58e7a..799f3424bf3e6e8c94b851159370b18b2be51775 100644 (file)
@@ -83,7 +83,6 @@ void SeekSlider::setMediaObject(Phonon::MediaObject *media)
                connect(m_media, SIGNAL(tick(qint64)), SLOT(tick(qint64)));
                connect(m_media, SIGNAL(seekableChanged(bool)), SLOT(seekableChanged(bool)));
                connect(m_media, SIGNAL(currentSourceChanged(const Phonon::MediaSource&)), SLOT(currentSourceChanged()));
-               connect(this, SIGNAL(valueChanged(int)), SLOT(seek(int)));
                stateChanged(m_media->state());
                seekableChanged(m_media->isSeekable());
                length(m_media->totalTime());
@@ -189,6 +188,7 @@ void SeekSlider::length(qint64 msec)
 {
        ticking = true;
        setLength(msec);
+       previuousPos.clear();
        ticking = false;
 }