Skip to content

Commit

Permalink
qmdiEditor: move toolbar to the top
Browse files Browse the repository at this point in the history
1) Moved the toolbar to the top. It looks nicer.
2) No longer using a toolbar, but a simple widget. Hiden GUI no longer
affects this contol.
  • Loading branch information
diegoiast committed Jan 4, 2025
1 parent 9ab9251 commit 43d5f33
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions src/widgets/qmdieditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,22 +156,27 @@ qmdiEditor::qmdiEditor(QWidget *p, Qutepart::ThemeManager *themes)
operationsWidget = new TextOperationsWidget(this, textEditor);
mdiClientName = tr("NO NAME");
fileSystemWatcher = new QFileSystemWatcher(this);
QToolBar *toolbar = new QToolBar(this);
QVBoxLayout *layout = new QVBoxLayout(this);
auto toolbar = new QWidget(this);
auto layout2 = new QHBoxLayout(toolbar);
auto layout = new QVBoxLayout(this);

operationsWidget->hide();
setupActions();
toolbar->addWidget(comboChangeHighlighter);
toolbar->addWidget(buttonChangeIndenter);
layout2->setSpacing(0);
layout2->setContentsMargins(0,2,0,2);
toolbar->setLayout(layout2);
toolbar->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum);
toolbar->layout()->addWidget(comboChangeHighlighter);
toolbar->layout()->addWidget(buttonChangeIndenter);

QSplitter *splitter = new QSplitter(Qt::Horizontal, this);
QWidget *spacer = new QWidget(this);
QLabel *staticLabel = new QLabel("", toolbar);
QLabel *staticLabel = new QLabel("", this);

spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
toolbar->addWidget(spacer);
toolbar->addWidget(staticLabel);
toolbar->addWidget(previewButton);
toolbar->layout()->addWidget(spacer);
toolbar->layout()->addWidget(staticLabel);
toolbar->layout()->addWidget(previewButton);

textPreview = new TextPreview(this);
textPreview->setVisible(false);
Expand Down Expand Up @@ -205,9 +210,9 @@ qmdiEditor::qmdiEditor(QWidget *p, Qutepart::ThemeManager *themes)

layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
layout->addWidget(toolbar);
layout->addWidget(banner);
layout->addWidget(splitter);
layout->addWidget(toolbar);
layout->addWidget(operationsWidget);

textOperationsMenu = new QMenu(tr("Text actions"), this);
Expand Down

0 comments on commit 43d5f33

Please sign in to comment.