Fix issues when starting maximised.
This commit is contained in:
@@ -72,6 +72,7 @@
|
||||
in plain text!
|
||||
51. Fix Lastfm response parsing.
|
||||
52. Dynamically load folder view.
|
||||
53. Fix starting Cantata maximised.
|
||||
|
||||
1.5.2
|
||||
-----
|
||||
|
||||
@@ -525,20 +525,18 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
resize(playPauseTrackButton->width()*25, playPauseTrackButton->height()*18);
|
||||
splitter->setSizes(QList<int>() << width*0.4 << width*0.6);
|
||||
} else {
|
||||
QSize sz=Settings::self()->mainWindowSize();
|
||||
if (!sz.isEmpty() && sz.width()>0) {
|
||||
resize(sz);
|
||||
} else {
|
||||
resize(playPauseTrackButton->width()*25, playPauseTrackButton->height()*18);
|
||||
}
|
||||
|
||||
if (expandInterfaceAction->isChecked()) {
|
||||
if (!expandedSize.isEmpty() && expandedSize.width()>0) {
|
||||
resize(expandedSize);
|
||||
expandOrCollapse(false);
|
||||
if (!expandedSize.isEmpty()) {
|
||||
if (expandedSize.width()>1) {
|
||||
resize(expandedSize);
|
||||
expandOrCollapse(false);
|
||||
} else {
|
||||
showMaximized();
|
||||
expandedSize=size();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!collapsedSize.isEmpty() && collapsedSize.width()>0) {
|
||||
if (!collapsedSize.isEmpty() && collapsedSize.width()>1) {
|
||||
resize(collapsedSize);
|
||||
expandOrCollapse(false);
|
||||
}
|
||||
@@ -915,7 +913,11 @@ MainWindow::~MainWindow()
|
||||
bool hadCantataStreams=PlayQueueModel::self()->removeCantataStreams();
|
||||
Settings::self()->saveShowFullScreen(fullScreenAction->isChecked());
|
||||
if (!fullScreenAction->isChecked()) {
|
||||
Settings::self()->saveMainWindowSize(expandInterfaceAction->isChecked() ? size() : expandedSize);
|
||||
if (expandInterfaceAction->isChecked()) {
|
||||
Settings::self()->saveMainWindowSize(isMaximized() ? QSize(1, 1) : size());
|
||||
} else {
|
||||
Settings::self()->saveMainWindowSize(expandedSize);
|
||||
}
|
||||
Settings::self()->saveMainWindowCollapsedSize(expandInterfaceAction->isChecked() ? collapsedSize : size());
|
||||
Settings::self()->saveShowPlaylist(expandInterfaceAction->isChecked());
|
||||
}
|
||||
|
||||
@@ -808,9 +808,7 @@ void Settings::saveSplitterAutoHide(bool v)
|
||||
|
||||
void Settings::saveMainWindowSize(const QSize &v)
|
||||
{
|
||||
if (v.width()>16 && v.height()>16) {
|
||||
cfg.set("mainWindowSize", v);
|
||||
}
|
||||
cfg.set("mainWindowSize", v);
|
||||
}
|
||||
|
||||
void Settings::saveMainWindowCollapsedSize(const QSize &v)
|
||||
|
||||
Reference in New Issue
Block a user