Commit 902710bf authored by Christoph Pfister's avatar Christoph Pfister

return to minimal mode after fullscreen

minimal mode --f--> full screen mode --f--> minimal mode
parent 36609ec1
......@@ -368,6 +368,7 @@ MainWindow::~MainWindow()
case MediaWidget::NormalMode: value = 0; break;
case MediaWidget::MinimalMode: value = 1; break;
case MediaWidget::FullScreenMode: value = 2; break;
case MediaWidget::FullScreenReturnToMinimalMode: value = 2; break;
}
KGlobal::config()->group("MainWindow").writeEntry("DisplayMode", value);
......@@ -492,14 +493,20 @@ void MainWindow::parseArgs()
void MainWindow::displayModeChanged()
{
if (mediaWidget->getDisplayMode() == MediaWidget::FullScreenMode) {
switch (mediaWidget->getDisplayMode()) {
case MediaWidget::FullScreenMode:
case MediaWidget::FullScreenReturnToMinimalMode:
setWindowState(windowState() | Qt::WindowFullScreen);
} else {
break;
case MediaWidget::MinimalMode:
case MediaWidget::NormalMode:
setWindowState(windowState() & (~Qt::WindowFullScreen));
break;
}
switch (mediaWidget->getDisplayMode()) {
case MediaWidget::FullScreenMode:
case MediaWidget::FullScreenReturnToMinimalMode:
case MediaWidget::MinimalMode:
menuBar()->hide();
navigationBar->hide();
......
......@@ -392,28 +392,28 @@ MediaWidget::DisplayMode MediaWidget::getDisplayMode() const
void MediaWidget::setDisplayMode(DisplayMode displayMode_)
{
if (displayMode != displayMode_) {
displayMode = displayMode_;
switch (displayMode) {
case NormalMode:
break;
case FullScreenMode:
case MinimalMode:
fullScreenAction->setIcon(KIcon(QLatin1String("view-fullscreen")));
fullScreenAction->setText(i18nc("'Playback' menu", "Full Screen Mode"));
break;
case MinimalMode:
minimalModeAction->setIcon(KIcon(QLatin1String("view-restore")));
minimalModeAction->setText(i18nc("'Playback' menu", "Minimal Mode"));
case FullScreenMode:
case FullScreenReturnToMinimalMode:
fullScreenAction->setIcon(KIcon(QLatin1String("view-restore")));
fullScreenAction->setText(i18nc("'Playback' menu",
"Exit Full Screen Mode"));
break;
}
displayMode = displayMode_;
switch (displayMode) {
case NormalMode:
break;
case FullScreenMode:
fullScreenAction->setIcon(KIcon(QLatin1String("view-restore")));
fullScreenAction->setText(i18nc("'Playback' menu",
"Exit Full Screen Mode"));
case FullScreenReturnToMinimalMode:
minimalModeAction->setIcon(KIcon(QLatin1String("view-restore")));
minimalModeAction->setText(i18nc("'Playback' menu", "Minimal Mode"));
break;
case MinimalMode:
minimalModeAction->setIcon(KIcon(QLatin1String("view-fullscreen")));
......@@ -657,19 +657,33 @@ void MediaWidget::volumeChanged(int volume)
void MediaWidget::toggleFullScreen()
{
if (displayMode == FullScreenMode) {
setDisplayMode(NormalMode);
} else {
switch (displayMode) {
case NormalMode:
setDisplayMode(FullScreenMode);
break;
case FullScreenMode:
setDisplayMode(NormalMode);
break;
case FullScreenReturnToMinimalMode:
setDisplayMode(MinimalMode);
break;
case MinimalMode:
setDisplayMode(FullScreenReturnToMinimalMode);
break;
}
}
void MediaWidget::toggleMinimalMode()
{
if (displayMode == MinimalMode) {
setDisplayMode(NormalMode);
} else {
switch (displayMode) {
case NormalMode:
case FullScreenMode:
case FullScreenReturnToMinimalMode:
setDisplayMode(MinimalMode);
break;
case MinimalMode:
setDisplayMode(NormalMode);
break;
}
}
......
......@@ -61,6 +61,7 @@ public:
{
NormalMode,
FullScreenMode,
FullScreenReturnToMinimalMode,
MinimalMode
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment