Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/NotepadNext/dialogs/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,9 @@ MainWindow::MainWindow(NotepadNextApplication *app) :
});
connect(app->getSettings(), &ApplicationSettings::showToolBarChanged, ui->mainToolBar, &QToolBar::setVisible);
connect(app->getSettings(), &ApplicationSettings::showStatusBarChanged, ui->statusBar, &QStatusBar::setVisible);
connect(ui->statusBar, &EditorInfoStatusBar::customContextMenuRequestedForEOLLabel, this, [=](const QPoint &pos){
ui->menuEOLConversion->popup(pos);
});

// It seems restoreState() does not affect the status bar so set it manually
ui->statusBar->setVisible(app->getSettings()->showStatusBar());
Expand Down
16 changes: 4 additions & 12 deletions src/NotepadNext/widgets/EditorInfoStatusBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,25 +37,17 @@ EditorInfoStatusBar::EditorInfoStatusBar(QMainWindow *window) :

eolFormat = new StatusLabel(100);
addPermanentWidget(eolFormat, 0);
eolFormat->setContextMenuPolicy(Qt::CustomContextMenu);
connect(qobject_cast<StatusLabel*>(eolFormat), &StatusLabel::customContextMenuRequested, this, [=](const QPoint &pos) {
emit customContextMenuRequestedForEOLLabel(eolFormat->mapToGlobal(pos));
});

unicodeType = new StatusLabel(125);
addPermanentWidget(unicodeType, 0);

overType = new StatusLabel(25);
addPermanentWidget(overType, 0);

/*
docType->setContextMenuPolicy(Qt::CustomContextMenu);
connect(docType, &QLabel::customContextMenuRequested, [=](const QPoint &pos) {
ui->menuLanguage->popup(docType->mapToGlobal(pos));
});

eolFormat->setContextMenuPolicy(Qt::CustomContextMenu);
connect(eolFormat, &QLabel::customContextMenuRequested, [=](const QPoint &pos) {
ui->menuEOLConversion->popup(eolFormat->mapToGlobal(pos));
});
*/

MainWindow *w = qobject_cast<MainWindow *>(window);

connect(w, &MainWindow::editorActivated, this, &EditorInfoStatusBar::connectToEditor);
Expand Down
3 changes: 3 additions & 0 deletions src/NotepadNext/widgets/EditorInfoStatusBar.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ class EditorInfoStatusBar : public QStatusBar

void refresh(ScintillaNext *editor);

signals:
void customContextMenuRequestedForEOLLabel(const QPoint &pos);

private slots:
void connectToEditor(ScintillaNext *editor);

Expand Down