mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-24 05:45:27 +00:00
Remove old sidebar
This commit is contained in:
parent
4833a1bdc7
commit
294eb672d7
@ -89,7 +89,6 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
asmDock(nullptr),
|
||||
calcDock(nullptr),
|
||||
omnibar(nullptr),
|
||||
sideBar(nullptr),
|
||||
ui(new Ui::MainWindow),
|
||||
highlighter(nullptr),
|
||||
hex_highlighter(nullptr),
|
||||
@ -106,7 +105,6 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
dashboardDock(nullptr),
|
||||
gotoEntry(nullptr),
|
||||
sdbDock(nullptr),
|
||||
sidebar_action(nullptr),
|
||||
sectionsDock(nullptr),
|
||||
consoleWidget(nullptr)
|
||||
{
|
||||
@ -152,18 +150,18 @@ void MainWindow::initUI()
|
||||
spacer3->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||
spacer3->setMinimumSize(20, 20);
|
||||
spacer3->setMaximumWidth(300);
|
||||
ui->mainToolBar->insertWidget(ui->actionShow_Hide_mainsidebar, spacer3);
|
||||
ui->mainToolBar->addWidget(spacer3);
|
||||
|
||||
// Omnibar LineEdit
|
||||
this->omnibar = new Omnibar(this);
|
||||
ui->mainToolBar->insertWidget(ui->actionShow_Hide_mainsidebar, this->omnibar);
|
||||
ui->mainToolBar->addWidget(this->omnibar);
|
||||
|
||||
// Add special separators to the toolbar that expand to separate groups of elements
|
||||
QWidget *spacer2 = new QWidget();
|
||||
spacer2->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||
spacer2->setMinimumSize(10, 10);
|
||||
spacer2->setMaximumWidth(300);
|
||||
ui->mainToolBar->insertWidget(ui->actionShow_Hide_mainsidebar, spacer2);
|
||||
ui->mainToolBar->addWidget(spacer2);
|
||||
|
||||
// Separator between back/forward and undo/redo buttons
|
||||
QWidget *spacer = new QWidget();
|
||||
@ -281,11 +279,6 @@ void MainWindow::initUI()
|
||||
setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea);
|
||||
//setCorner( Qt::BottomRightCorner, Qt::RightDockWidgetArea );
|
||||
|
||||
// Setup and hide sidebar by default
|
||||
this->sideBar = new SideBar(this);
|
||||
this->sidebar_action = ui->sideToolBar->addWidget(this->sideBar);
|
||||
ui->sideToolBar->hide();
|
||||
|
||||
// Show dashboard by default
|
||||
this->dashboardDock->raise();
|
||||
|
||||
@ -392,9 +385,16 @@ bool MainWindow::saveProjectAs(bool quit)
|
||||
|
||||
}
|
||||
|
||||
void MainWindow::toggleSideBarTheme()
|
||||
void MainWindow::toggleTheme()
|
||||
{
|
||||
sideBar->themesButtonToggle();
|
||||
if (QSettings().value("dark").toBool())
|
||||
{
|
||||
def_theme();
|
||||
}
|
||||
else
|
||||
{
|
||||
dark();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::refreshOmniBar(const QStringList &flags)
|
||||
@ -707,28 +707,12 @@ void MainWindow::on_actionForward_triggered()
|
||||
core->seekNext();
|
||||
}
|
||||
|
||||
void MainWindow::on_actionCalculator_triggered()
|
||||
{
|
||||
if (!this->sideBar->isVisible())
|
||||
{
|
||||
this->on_actionShow_Hide_mainsidebar_triggered();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_actionCreate_File_triggered()
|
||||
{
|
||||
CreateNewDialog *n = new CreateNewDialog(this);
|
||||
n->exec();
|
||||
}
|
||||
|
||||
void MainWindow::on_actionAssembler_triggered()
|
||||
{
|
||||
if (!this->sideBar->isVisible())
|
||||
{
|
||||
this->on_actionShow_Hide_mainsidebar_triggered();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_actionDisasAdd_comment_triggered()
|
||||
{
|
||||
CommentsDialog *c = new CommentsDialog(this);
|
||||
@ -922,18 +906,6 @@ void MainWindow::on_actionLoad_triggered()
|
||||
process.startDetached(qApp->applicationFilePath());
|
||||
}
|
||||
|
||||
void MainWindow::on_actionShow_Hide_mainsidebar_triggered()
|
||||
{
|
||||
if (ui->sideToolBar->isVisible())
|
||||
{
|
||||
ui->sideToolBar->hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->sideToolBar->show();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_actionDashboard_triggered()
|
||||
{
|
||||
if (this->dashboardDock->isVisible())
|
||||
|
@ -18,7 +18,7 @@ class DockWidget;
|
||||
class Omnibar;
|
||||
class PreviewWidget;
|
||||
class Notepad;
|
||||
class SideBar;
|
||||
//class SideBar;
|
||||
class Highlighter;
|
||||
class AsciiHighlighter;
|
||||
class GraphicsBar;
|
||||
@ -75,7 +75,6 @@ public:
|
||||
*/
|
||||
bool saveProjectAs(bool quit = false);
|
||||
|
||||
void start_web_server();
|
||||
void closeEvent(QCloseEvent *event) override;
|
||||
void readSettings();
|
||||
void setFilename(const QString &fn);
|
||||
@ -85,7 +84,7 @@ public:
|
||||
void addOutput(const QString &msg);
|
||||
void addDebugOutput(const QString &msg);
|
||||
void sendToNotepad(const QString &txt);
|
||||
void toggleSideBarTheme();
|
||||
void toggleTheme();
|
||||
void refreshOmniBar(const QStringList &flags);
|
||||
|
||||
public slots:
|
||||
@ -136,12 +135,8 @@ private slots:
|
||||
|
||||
void on_actionRefresh_Panels_triggered();
|
||||
|
||||
void on_actionCalculator_triggered();
|
||||
|
||||
void on_actionCreate_File_triggered();
|
||||
|
||||
void on_actionAssembler_triggered();
|
||||
|
||||
void on_actionDisasAdd_comment_triggered();
|
||||
|
||||
void on_actionDefaut_triggered();
|
||||
@ -159,8 +154,6 @@ private slots:
|
||||
|
||||
void on_actionLoad_triggered();
|
||||
|
||||
void on_actionShow_Hide_mainsidebar_triggered();
|
||||
|
||||
void on_actionForward_triggered();
|
||||
|
||||
void on_actionTabs_on_Top_triggered();
|
||||
@ -187,7 +180,7 @@ private:
|
||||
QDockWidget *asmDock;
|
||||
QDockWidget *calcDock;
|
||||
Omnibar *omnibar;
|
||||
SideBar *sideBar;
|
||||
//SideBar *sideBar;
|
||||
Configuration *configuration;
|
||||
|
||||
bool doLock;
|
||||
@ -212,7 +205,7 @@ private:
|
||||
Dashboard *dashboardDock;
|
||||
QLineEdit *gotoEntry;
|
||||
SdbDock *sdbDock;
|
||||
QAction *sidebar_action;
|
||||
//QAction *sidebar_action;
|
||||
SectionsDock *sectionsDock;
|
||||
ConsoleWidget *consoleWidget;
|
||||
|
||||
|
@ -287,46 +287,6 @@ border-top: 0px;
|
||||
<addaction name="menuWindows"/>
|
||||
<addaction name="menuHelp"/>
|
||||
</widget>
|
||||
<widget class="QToolBar" name="sideToolBar">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string notr="true">Side toolbar</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border: 1px solid rgb(64, 64, 64);
|
||||
background-color: rgb(64, 64, 64);
|
||||
background: rgb(64, 64, 64);</string>
|
||||
</property>
|
||||
<property name="movable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="allowedAreas">
|
||||
<set>Qt::RightToolBarArea</set>
|
||||
</property>
|
||||
<property name="floatable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<attribute name="toolBarArea">
|
||||
<enum>RightToolBarArea</enum>
|
||||
</attribute>
|
||||
<attribute name="toolBarBreak">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QToolBar" name="mainToolBar">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
@ -375,7 +335,6 @@ QToolButton .svg-icon path {
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<addaction name="actionForward"/>
|
||||
<addaction name="actionShow_Hide_mainsidebar"/>
|
||||
</widget>
|
||||
<action name="actionCalculator">
|
||||
<property name="text">
|
||||
@ -961,18 +920,6 @@ QToolButton .svg-icon path {
|
||||
<string>Run script</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionShow_Hide_mainsidebar">
|
||||
<property name="icon">
|
||||
<iconset resource="resources.qrc">
|
||||
<normaloff>:/img/icons/sidebar.svg</normaloff>:/img/icons/sidebar.svg</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Show/Hide mainsidebar</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Show/Hide Sidebar</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionDashboard">
|
||||
<property name="text">
|
||||
<string>Dashboard</string>
|
||||
|
@ -161,7 +161,7 @@ void Omnibar::on_gotoEntry_returnPressed()
|
||||
}
|
||||
else if (str.contains("Theme"))
|
||||
{
|
||||
this->main->toggleSideBarTheme();
|
||||
this->main->toggleTheme();
|
||||
}
|
||||
else if (str.contains("Script"))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user