Skip to content

Commit b70157f

Browse files
committed
fix: can not toggle mini mode when window maximized
linuxdeepin/internal-discussion#719 Change-Id: Iba466e722b315978fc5c3f9dc7a42f17eae62574
1 parent 11234d1 commit b70157f

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/common/mainwindow.cpp

+7-2
Original file line numberDiff line numberDiff line change
@@ -1358,7 +1358,7 @@ bool MainWindow::isActionAllowed(ActionFactory::ActionKind kd, bool fromUI, bool
13581358
if (isMaximized()) {
13591359
switch(kd) {
13601360
case ActionFactory::ToggleMiniMode:
1361-
return false;
1361+
return true;
13621362
default: break;
13631363
}
13641364
}
@@ -2663,6 +2663,9 @@ void MainWindow::toggleUIMode()
26632663
if (isFullScreen()) {
26642664
_stateBeforeMiniMode |= SBEM_Fullscreen;
26652665
requestAction(ActionFactory::QuitFullscreen);
2666+
} else if (isMaximized()) {
2667+
_stateBeforeMiniMode |= SBEM_Maximized;
2668+
showNormal();
26662669
} else {
26672670
_lastRectInNormalMode = geometry();
26682671
}
@@ -2695,7 +2698,9 @@ void MainWindow::toggleUIMode()
26952698
if (_stateBeforeMiniMode & SBEM_Above) {
26962699
requestAction(ActionFactory::WindowAbove);
26972700
}
2698-
if (_stateBeforeMiniMode & SBEM_Fullscreen) {
2701+
if (_stateBeforeMiniMode & SBEM_Maximized) {
2702+
showMaximized();
2703+
} else if (_stateBeforeMiniMode & SBEM_Fullscreen) {
26992704
requestAction(ActionFactory::ToggleFullscreen);
27002705
} else {
27012706
if (_engine->state() == PlayerEngine::Idle && windowState() == Qt::WindowNoState) {

src/common/mainwindow.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ protected slots:
210210
SBEM_Above = 0x01,
211211
SBEM_Fullscreen = 0x02,
212212
SBEM_PlaylistOpened = 0x04,
213-
SBEM_Maximized = 0x02,
213+
SBEM_Maximized = 0x08,
214214
};
215215
int _stateBeforeMiniMode {0};
216216
Qt::WindowStates _lastWindowState {Qt::WindowNoState};

0 commit comments

Comments
 (0)