Skip to content

Commit

Permalink
feat: Remove the option button of top toolbar
Browse files Browse the repository at this point in the history
Remove the option button of top toolbar and thie titlebar of edit mainwindow.
  • Loading branch information
N0rthHXD authored and deepin-mozart committed Nov 17, 2023
1 parent 899f6c6 commit abe6244
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
3 changes: 1 addition & 2 deletions src/plugins/codeeditor/mainframe/naveditmainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ NavEditMainWindow::NavEditMainWindow(QWidget *parent, Qt::WindowFlags flags)
addDockWidget(Qt::DockWidgetArea::BottomDockWidgetArea, qDockWidgetContext);
mainToolBar = new ToolBarManager(tr("toolbar"));

titlebar()->setParent(nullptr);
titlebar()->hide();
titlebar()->setFixedHeight(0);
}

NavEditMainWindow::~NavEditMainWindow()
Expand Down
13 changes: 1 addition & 12 deletions src/plugins/option/optioncore/optioncore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,28 +55,17 @@ bool OptionCore::start()

if (windowService && windowService->addAction && windowService->addToolBarActionItem) {
auto actionOptions = new QAction(MWMTA_OPTIONS);
auto actionOptionsNoIcon = new QAction(MWMTA_OPTIONS);
ActionManager::getInstance()->registerAction(actionOptions,
"Tools.Options",
MWMTA_OPTIONS,
QKeySequence(Qt::Modifier::CTRL |
Qt::Modifier::SHIFT |
Qt::Key::Key_H),
":/optioncore/images/setting.png");
ActionManager::getInstance()->registerAction(actionOptions,
"Tools.Options",
MWMTA_OPTIONS,
QKeySequence(Qt::Modifier::CTRL |
Qt::Modifier::SHIFT |
Qt::Key::Key_H),
QString());
windowService->addAction(MWM_TOOLS, new AbstractAction(actionOptionsNoIcon));
windowService->addToolBarActionItem("Options", actionOptions, "Option.End");
windowService->addAction(MWM_TOOLS, new AbstractAction(actionOptions));

QObject::connect(actionOptions, &QAction::triggered,
optionDialog, &QDialog::show);
QObject::connect(actionOptionsNoIcon, &QAction::triggered,
optionDialog, &QDialog::show);
}

DPF_USE_NAMESPACE
Expand Down

0 comments on commit abe6244

Please sign in to comment.