WIP: put the editor options into a separate dockable widget

This commit is contained in:
Matthias Koefferlein
2020-08-08 21:10:01 +02:00
parent 2714b34104
commit cdce2cb151
17 changed files with 318 additions and 368 deletions
@@ -467,6 +467,12 @@ Class<lay::LayoutView> decl_LayoutView (QT_EXTERNAL_BASE (QWidget) "lay", "Layou
"\n"
"This constant has been introduced in version 0.27.\n"
) +
gsi::constant ("LV_NoEditorOptionsPanel", (unsigned int) lay::LayoutView::LV_NoEditorOptionsPanel,
"@brief With this option, no editor options panel will be provided (see \\editor_options_frame)\n"
"Use this value with the constructor's 'options' argument.\n"
"\n"
"This constant has been introduced in version 0.27.\n"
) +
gsi::constant ("LV_NoBookmarksView", (unsigned int) lay::LayoutView::LV_NoBookmarksView,
"@brief With this option, no bookmarks view will be provided (see \\bookmarks_frame)\n"
"Use this value with the constructor's 'options' argument.\n"
+22
View File
@@ -390,6 +390,7 @@ LayoutView::init (db::Manager *mgr, QWidget * /*parent*/)
mp_libraries_view = 0;
mp_bookmarks_view = 0;
mp_libraries_frame = 0;
mp_editor_options_frame = 0;
mp_bookmarks_frame = 0;
mp_min_hier_spbx = 0;
mp_max_hier_spbx = 0;
@@ -557,6 +558,20 @@ LayoutView::init (db::Manager *mgr, QWidget * /*parent*/)
}
if (is_editable () && (m_options & LV_NoEditorOptionsPanel) == 0 && (m_options & LV_Naked) == 0) {
QFrame *editor_options_frame = new QFrame (0);
editor_options_frame->setObjectName (QString::fromUtf8 ("editor_options_frame"));
mp_editor_options_frame = editor_options_frame;
QVBoxLayout *left_frame_ly = new QVBoxLayout (editor_options_frame);
left_frame_ly->setMargin (0);
left_frame_ly->setSpacing (0);
connect (mp_editor_options_frame, SIGNAL (destroyed ()), this, SLOT (side_panel_destroyed ()));
}
// occupy services and editables:
// these services get deleted by the canvas destructor automatically:
if ((m_options & LV_NoTracker) == 0) {
@@ -686,6 +701,11 @@ LayoutView::~LayoutView ()
mp_libraries_frame = 0;
mp_libraries_view = 0;
if (mp_editor_options_frame) {
delete mp_editor_options_frame;
}
mp_editor_options_frame = 0;
if (mp_bookmarks_frame) {
delete mp_bookmarks_frame;
}
@@ -709,6 +729,8 @@ void LayoutView::side_panel_destroyed ()
} else if (sender () == mp_libraries_frame) {
mp_libraries_frame = 0;
mp_libraries_view = 0;
} else if (sender () == mp_editor_options_frame) {
mp_editor_options_frame = 0;
} else if (sender () == mp_bookmarks_frame) {
mp_bookmarks_frame = 0;
mp_bookmarks_view = 0;
+18 -9
View File
@@ -175,14 +175,15 @@ public:
LV_NoLayers = 1,
LV_NoHierarchyPanel = 2,
LV_NoLibrariesView = 4,
LV_NoBookmarksView = 8,
LV_Naked = 16,
LV_NoZoom = 32,
LV_NoGrid = 64,
LV_NoMove = 128,
LV_NoTracker = 256,
LV_NoSelection = 512,
LV_NoPlugins = 1024,
LV_NoEditorOptionsPanel = 8,
LV_NoBookmarksView = 16,
LV_Naked = 32,
LV_NoZoom = 64,
LV_NoGrid = 128,
LV_NoMove = 256,
LV_NoTracker = 512,
LV_NoSelection = 1024,
LV_NoPlugins = 2048,
LV_NoServices = LV_NoMove + LV_NoTracker + LV_NoSelection + LV_NoPlugins
};
@@ -268,6 +269,14 @@ public:
return mp_libraries_frame;
}
/**
* @brief Gets the container with the editor options
*/
QWidget *editor_options_frame ()
{
return mp_editor_options_frame;
}
/**
* @brief Gets the container with the bookmarks view
*/
@@ -2708,7 +2717,7 @@ private:
lay::HierarchyControlPanel *mp_hierarchy_panel;
lay::LibrariesView *mp_libraries_view;
lay::BookmarksView *mp_bookmarks_view;
QWidget *mp_control_frame, *mp_hierarchy_frame, *mp_libraries_frame, *mp_bookmarks_frame;
QWidget *mp_control_frame, *mp_hierarchy_frame, *mp_libraries_frame, *mp_editor_options_frame, *mp_bookmarks_frame;
QSpinBox *mp_min_hier_spbx;
QSpinBox *mp_max_hier_spbx;
std::list <CellView> m_cellviews;
@@ -2065,7 +2065,7 @@ public:
menu_entries.push_back (lay::menu_item ("cm_select_next_item", "select_next_item:edit", at, tl::to_string (QObject::tr ("Select Next Item(Space)"))));
menu_entries.push_back (lay::menu_item ("cm_select_next_item_add", "select_next_item_add:edit", at, tl::to_string (QObject::tr ("Select Next Item too(Shift+Space)"))));
at = "edit_menu.end";
at = "edit_menu.edit_options_group";
menu_entries.push_back (lay::menu_item ("cm_undo", "undo:edit", at, tl::to_string (QObject::tr ("Undo(Ctrl+Z)"))));
menu_entries.push_back (lay::menu_item ("cm_redo", "redo:edit", at, tl::to_string (QObject::tr ("Redo(Ctrl+Y)"))));