mirror of
https://github.com/Murmele/Gittyup.git
synced 2024-09-11 02:35:41 +03:00
Added a checkbox in the settings "Tools>Options>Window>View>Show Maximized".
Added a check for the checkbox when the window opens to show maximized if checked.
This commit is contained in:
parent
26e92309cb
commit
7fa407d900
@ -295,15 +295,12 @@ bool Application::restoreWindows() {
|
||||
if (dir != Settings::appDir()) {
|
||||
if (MainWindow *win = MainWindow::open(dir.path(), false)) {
|
||||
win->currentView()->setPathspec(mPathspec);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Save on exit.
|
||||
MainWindow::setSaveWindowSettings(true);
|
||||
|
||||
|
@ -19,6 +19,7 @@ void Setting::initialize(QMap<Id, QString> &keys) {
|
||||
keys[Id::OpenAllReposInTabs] = "window/tabs/repository";
|
||||
keys[Id::HideMenuBar] = "window/view/menuBarHidden";
|
||||
keys[Id::ShowAvatars] = "window/view/avatarsVisible";
|
||||
keys[Id::ShowMaximized] = "window/view/showMaximized";
|
||||
keys[Id::AutoCollapseAddedFiles] = "collapse/added";
|
||||
keys[Id::AutoCollapseDeletedFiles] = "collapse/deleted";
|
||||
keys[Id::FilemanagerCommand] = "filemanager/command";
|
||||
|
@ -43,6 +43,7 @@ public:
|
||||
OpenAllReposInTabs,
|
||||
HideMenuBar,
|
||||
ShowAvatars,
|
||||
ShowMaximized,
|
||||
AutoCollapseAddedFiles,
|
||||
AutoCollapseDeletedFiles,
|
||||
FilemanagerCommand,
|
||||
|
@ -565,6 +565,11 @@ public:
|
||||
connect(showAvatars, &QCheckBox::toggled, [](bool checked) {
|
||||
Settings::instance()->setValue(Setting::Id::ShowAvatars, checked);
|
||||
});
|
||||
QCheckBox *showMaximized = new QCheckBox(tr("Show Window Maximized when opened"));
|
||||
showMaximized->setChecked(settings->value(Setting::Id::ShowMaximized).toBool());
|
||||
connect(showMaximized, &QCheckBox::toggled, [](bool checked) {
|
||||
Settings::instance()->setValue(Setting::Id::ShowMaximized, checked);
|
||||
});
|
||||
|
||||
QString mergeText = settings->promptDescription(Prompt::Kind::Merge);
|
||||
QCheckBox *merge = new QCheckBox(mergeText, this);
|
||||
@ -619,6 +624,7 @@ public:
|
||||
layout->addRow(QString(), repoTabs);
|
||||
layout->addRow(tr("View:"), hideMenuBar);
|
||||
layout->addRow(QString(), showAvatars);
|
||||
layout->addRow(QString(), showMaximized);
|
||||
layout->addRow(tr("Prompt:"), merge);
|
||||
layout->addRow(QString(), revert);
|
||||
layout->addRow(QString(), cherryPick);
|
||||
|
@ -301,7 +301,6 @@ QList<MainWindow *> MainWindow::windows() {
|
||||
return mainWins;
|
||||
}
|
||||
|
||||
|
||||
bool MainWindow::restoreWindows() {
|
||||
QList<MainWindow *> windows;
|
||||
|
||||
@ -387,8 +386,16 @@ MainWindow *MainWindow::open(const git::Repository &repo) {
|
||||
|
||||
// Create the window.
|
||||
MainWindow *window = new MainWindow(repo);
|
||||
window->showMaximized();
|
||||
|
||||
const bool showMaximized =
|
||||
Settings::instance()->value(Setting::Id::ShowMaximized).toBool();
|
||||
|
||||
if(showMaximized) {
|
||||
window->showMaximized();
|
||||
} else {
|
||||
window->show();
|
||||
}
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,6 @@
|
||||
#include "git/Repository.h"
|
||||
#include <QMainWindow>
|
||||
|
||||
|
||||
class RepoView;
|
||||
class TabWidget;
|
||||
class ToolBar;
|
||||
@ -23,7 +22,7 @@ namespace git {
|
||||
class Submodule;
|
||||
}
|
||||
|
||||
class MainWindow : public QMainWindow{
|
||||
class MainWindow : public QMainWindow {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
Loading…
Reference in New Issue
Block a user