summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGülşah Köse <gulsah.kose@collabora.com>2021-05-11 23:34:59 +0300
committerGülşah Köse <gulsah.kose@collabora.com>2021-05-12 11:19:25 +0200
commitdb35b9086476259fa2c047f2e4dfe7862d026530 (patch)
tree274cc302f7912db9b912f5157cce79b227498bec
parent95a1ccff3a252315e1c2499331ded4bc2e660d54 (diff)
tdf#141426 Remove GtkPaned struct unnecessary tabs.
In development tool we need GtkPaned for only properties tab. Unnecessary hide() show() calls for the other tabs(Interfaces, Services, Methods) causes complex problems about inital height of the second pane with gen plugin. Change-Id: I7523ef0bc425d7fc97ec5bd9e30e874f88e354f7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115450 Tested-by: Jenkins Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
-rw-r--r--include/sfx2/devtools/ObjectInspectorTreeHandler.hxx5
-rw-r--r--sfx2/source/devtools/ObjectInspectorTreeHandler.cxx21
-rw-r--r--sfx2/uiconfig/ui/developmenttool.ui359
3 files changed, 181 insertions, 204 deletions
diff --git a/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx b/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
index 0919bbfa3b9a..a9cf5be3dae6 100644
--- a/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
+++ b/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
@@ -40,9 +40,6 @@ private:
// just the current context
css::uno::Reference<css::uno::XComponentContext> mxContext;
- // should the paned size be reset to default on resize
- bool mbPanedResetSize;
-
static void clearObjectInspectorChildren(std::unique_ptr<weld::TreeView>& pTreeView,
weld::TreeIter const& rParent);
static void handleExpanding(std::unique_ptr<weld::TreeView>& pTreeView,
@@ -86,8 +83,6 @@ public:
DECL_LINK(NotebookEnterPage, const OString&, void);
DECL_LINK(NotebookLeavePage, const OString&, bool);
- DECL_LINK(PanedSizeChange, const Size&, void);
-
void introspect(css::uno::Reference<css::uno::XInterface> const& xInterface);
void dispose();
diff --git a/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx b/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx
index 62fb08229798..de81bd7df432 100644
--- a/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx
+++ b/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx
@@ -929,7 +929,6 @@ ObjectInspectorTreeHandler::ObjectInspectorTreeHandler(
std::unique_ptr<ObjectInspectorWidgets>& pObjectInspectorWidgets)
: mpObjectInspectorWidgets(pObjectInspectorWidgets)
, mxContext(comphelper::getProcessComponentContext())
- , mbPanedResetSize(true)
{
mpObjectInspectorWidgets->mpInterfacesTreeView->connect_expanding(
LINK(this, ObjectInspectorTreeHandler, ExpandingHandlerInterfaces));
@@ -962,15 +961,12 @@ ObjectInspectorTreeHandler::ObjectInspectorTreeHandler(
mpObjectInspectorWidgets->mpToolbar->set_item_sensitive("inspect", false);
mpObjectInspectorWidgets->mpToolbar->set_item_sensitive("back", false);
- mpObjectInspectorWidgets->mpTextView->hide();
-
mpObjectInspectorWidgets->mpNotebook->connect_leave_page(
LINK(this, ObjectInspectorTreeHandler, NotebookLeavePage));
mpObjectInspectorWidgets->mpNotebook->connect_enter_page(
LINK(this, ObjectInspectorTreeHandler, NotebookEnterPage));
- mpObjectInspectorWidgets->mpPaned->connect_size_allocate(
- LINK(this, ObjectInspectorTreeHandler, PanedSizeChange));
+ pObjectInspectorWidgets->mpPaned->set_position(160);
}
void ObjectInspectorTreeHandler::handleExpanding(std::unique_ptr<weld::TreeView>& pTreeView,
@@ -1085,8 +1081,6 @@ IMPL_LINK(ObjectInspectorTreeHandler, ToolbarButtonClicked, const OString&, rSel
IMPL_LINK(ObjectInspectorTreeHandler, NotebookEnterPage, const OString&, rPageId, void)
{
- mpObjectInspectorWidgets->mpTextView->hide();
-
uno::Any aAny = maInspectionStack.back();
if (!aAny.hasValue())
return;
@@ -1108,12 +1102,10 @@ IMPL_LINK(ObjectInspectorTreeHandler, NotebookEnterPage, const OString&, rPageId
}
else if (rPageId == "object_inspector_properties_tab")
{
- mbPanedResetSize = true;
mpObjectInspectorWidgets->mpPropertiesTreeView->freeze();
clearAll(mpObjectInspectorWidgets->mpPropertiesTreeView);
appendProperties(xInterface);
mpObjectInspectorWidgets->mpPropertiesTreeView->thaw();
- mpObjectInspectorWidgets->mpTextView->show();
}
else if (rPageId == "object_inspector_methods_tab")
{
@@ -1153,17 +1145,6 @@ IMPL_LINK(ObjectInspectorTreeHandler, NotebookLeavePage, const OString&, rPageId
return true;
}
-IMPL_LINK(ObjectInspectorTreeHandler, PanedSizeChange, const Size&, rSize, void)
-{
- if (mbPanedResetSize)
- {
- // Set position at 90% of the height
- tools::Long nHeight = rSize.Height();
- mpObjectInspectorWidgets->mpPaned->set_position(nHeight * 0.9);
- mbPanedResetSize = false;
- }
-}
-
void ObjectInspectorTreeHandler::clearObjectInspectorChildren(
std::unique_ptr<weld::TreeView>& pTreeView, weld::TreeIter const& rParent)
{
diff --git a/sfx2/uiconfig/ui/developmenttool.ui b/sfx2/uiconfig/ui/developmenttool.ui
index 826cf30a2fd8..58e03b3cf21a 100644
--- a/sfx2/uiconfig/ui/developmenttool.ui
+++ b/sfx2/uiconfig/ui/developmenttool.ui
@@ -95,6 +95,9 @@
<property name="model">liststore1</property>
<property name="search-column">0</property>
<property name="enable-tree-lines">True</property>
+ <child internal-child="selection">
+ <object class="GtkTreeSelection"/>
+ </child>
<child>
<object class="GtkTreeViewColumn" id="treecolumn">
<property name="resizable">True</property>
@@ -289,114 +292,112 @@
</packing>
</child>
<child>
- <object class="GtkPaned" id="object_inspector_paned">
+ <object class="GtkNotebook" id="object_inspector_notebookbar">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
- <property name="orientation">vertical</property>
<child>
- <object class="GtkNotebook" id="object_inspector_notebookbar">
+ <object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
+ <property name="shadow-type">in</property>
<child>
- <object class="GtkScrolledWindow">
+ <object class="GtkTreeView" id="interfaces_treeview_id">
<property name="visible">True</property>
<property name="can-focus">True</property>
+ <property name="receives-default">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
- <property name="shadow-type">in</property>
+ <property name="model">object_inspector_interfaces_liststore</property>
+ <property name="search-column">0</property>
+ <property name="enable-tree-lines">True</property>
<child>
- <object class="GtkTreeView" id="interfaces_treeview_id">
- <property name="visible">True</property>
- <property name="can-focus">True</property>
- <property name="receives-default">True</property>
- <property name="hexpand">True</property>
- <property name="vexpand">True</property>
- <property name="model">object_inspector_interfaces_liststore</property>
- <property name="search-column">0</property>
- <property name="enable-tree-lines">True</property>
+ <object class="GtkTreeViewColumn" id="interfaces_treeviewcolumn1">
+ <property name="resizable">True</property>
+ <property name="title" translatable="yes" context="developmenttool|name">Name</property>
+ <property name="clickable">True</property>
+ <property name="sort-indicator">True</property>
+ <property name="sort-column-id">0</property>
<child>
- <object class="GtkTreeViewColumn" id="interfaces_treeviewcolumn1">
- <property name="resizable">True</property>
- <property name="title" translatable="yes" context="developmenttool|name">Name</property>
- <property name="clickable">True</property>
- <property name="sort-indicator">True</property>
- <property name="sort-column-id">0</property>
- <child>
- <object class="GtkCellRendererText" id="obj_insp_cellrenderertext4"/>
- <attributes>
- <attribute name="text">0</attribute>
- </attributes>
- </child>
- </object>
+ <object class="GtkCellRendererText" id="obj_insp_cellrenderertext4"/>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
</child>
</object>
</child>
</object>
</child>
- <child type="tab">
- <object class="GtkLabel" id="object_inspector_interfaces_tab">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="label" translatable="yes" context="developmenttool|interfaces">Interfaces</property>
- </object>
- <packing>
- <property name="tab-fill">False</property>
- </packing>
- </child>
+ </object>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="object_inspector_interfaces_tab">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="label" translatable="yes" context="developmenttool|interfaces">Interfaces</property>
+ </object>
+ <packing>
+ <property name="tab-fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow">
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="shadow-type">in</property>
<child>
- <object class="GtkScrolledWindow">
+ <object class="GtkTreeView" id="services_treeview_id">
<property name="visible">True</property>
<property name="can-focus">True</property>
+ <property name="receives-default">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
- <property name="shadow-type">in</property>
+ <property name="model">object_inspector_services_liststore</property>
+ <property name="search-column">0</property>
+ <property name="enable-tree-lines">True</property>
<child>
- <object class="GtkTreeView" id="services_treeview_id">
- <property name="visible">True</property>
- <property name="can-focus">True</property>
- <property name="receives-default">True</property>
- <property name="hexpand">True</property>
- <property name="vexpand">True</property>
- <property name="model">object_inspector_services_liststore</property>
- <property name="search-column">0</property>
- <property name="enable-tree-lines">True</property>
+ <object class="GtkTreeViewColumn" id="services_treeviewcolumn1">
+ <property name="resizable">True</property>
+ <property name="title" translatable="yes" context="developmenttool|name">Name</property>
+ <property name="clickable">True</property>
+ <property name="sort-indicator">True</property>
+ <property name="sort-column-id">0</property>
<child>
- <object class="GtkTreeViewColumn" id="services_treeviewcolumn1">
- <property name="resizable">True</property>
- <property name="title" translatable="yes" context="developmenttool|name">Name</property>
- <property name="clickable">True</property>
- <property name="sort-indicator">True</property>
- <property name="sort-column-id">0</property>
- <child>
- <object class="GtkCellRendererText" id="obj_insp_cellrenderertext7"/>
- <attributes>
- <attribute name="text">0</attribute>
- </attributes>
- </child>
- </object>
+ <object class="GtkCellRendererText" id="obj_insp_cellrenderertext7"/>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
</child>
</object>
</child>
</object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child type="tab">
- <object class="GtkLabel" id="object_inspector_services_tab">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="label" translatable="yes" context="developmenttool|services">Services</property>
- </object>
- <packing>
- <property name="position">1</property>
- <property name="tab-fill">False</property>
- </packing>
</child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="object_inspector_services_tab">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="label" translatable="yes" context="developmenttool|services">Services</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ <property name="tab-fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkPaned" id="object_inspector_paned">
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="orientation">vertical</property>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
@@ -478,142 +479,142 @@
</child>
</object>
<packing>
- <property name="position">2</property>
- </packing>
- </child>
- <child type="tab">
- <object class="GtkLabel" id="object_inspector_properties_tab">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="label" translatable="yes" context="developmenttool|properties">Properties</property>
- </object>
- <packing>
- <property name="position">2</property>
- <property name="tab-fill">False</property>
+ <property name="resize">True</property>
+ <property name="shrink">True</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can-focus">True</property>
- <property name="hexpand">True</property>
- <property name="vexpand">True</property>
<property name="shadow-type">in</property>
<child>
- <object class="GtkTreeView" id="methods_treeview_id">
+ <object class="GtkTextView" id="object_inspector_text_view">
+ <property name="height-request">100</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
- <property name="receives-default">True</property>
- <property name="hexpand">True</property>
- <property name="vexpand">True</property>
- <property name="model">object_inspector_methods_liststore</property>
- <property name="search-column">0</property>
- <property name="enable-tree-lines">True</property>
- <child>
- <object class="GtkTreeViewColumn" id="methods_treeviewcolumn1">
- <property name="resizable">True</property>
- <property name="title" translatable="yes" context="developmenttool|method">Method</property>
- <property name="clickable">True</property>
- <property name="sort-indicator">True</property>
- <property name="sort-column-id">0</property>
- <child>
- <object class="GtkCellRendererText" id="obj_insp_cellrenderertext10"/>
- <attributes>
- <attribute name="text">0</attribute>
- </attributes>
- </child>
- </object>
- </child>
- <child>
- <object class="GtkTreeViewColumn" id="methods_treeviewcolumn2">
- <property name="resizable">True</property>
- <property name="title" translatable="yes" context="developmenttool|returntype">Return Type</property>
- <property name="clickable">True</property>
- <property name="sort-indicator">True</property>
- <property name="sort-column-id">1</property>
- <child>
- <object class="GtkCellRendererText" id="obj_insp_cellrenderertext11"/>
- <attributes>
- <attribute name="text">1</attribute>
- </attributes>
- </child>
- </object>
- </child>
- <child>
- <object class="GtkTreeViewColumn" id="methods_treeviewcolumn3">
- <property name="resizable">True</property>
- <property name="title" translatable="yes" context="developmenttool|parameters">Parameters</property>
- <property name="clickable">True</property>
- <property name="sort-indicator">True</property>
- <property name="sort-column-id">2</property>
- <child>
- <object class="GtkCellRendererText" id="obj_insp_cellrenderertext12"/>
- <attributes>
- <attribute name="text">2</attribute>
- </attributes>
- </child>
- </object>
- </child>
- <child>
- <object class="GtkTreeViewColumn" id="methods_treeviewcolumn4">
- <property name="resizable">True</property>
- <property name="title" translatable="yes" context="developmenttool|implementation_class">Implementation Class</property>
- <property name="clickable">True</property>
- <property name="sort-indicator">True</property>
- <property name="sort-column-id">3</property>
- <child>
- <object class="GtkCellRendererText" id="obj_insp_cellrenderertext13"/>
- <attributes>
- <attribute name="text">3</attribute>
- </attributes>
- </child>
- </object>
- </child>
+ <property name="editable">False</property>
+ <property name="wrap-mode">word</property>
+ <property name="cursor-visible">False</property>
+ <property name="accepts-tab">False</property>
+ <property name="monospace">True</property>
</object>
</child>
</object>
<packing>
- <property name="position">3</property>
- </packing>
- </child>
- <child type="tab">
- <object class="GtkLabel" id="object_inspector_methods_tab">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="label" translatable="yes" context="developmenttool|methods">Methods</property>
- </object>
- <packing>
- <property name="position">3</property>
- <property name="tab-fill">False</property>
+ <property name="resize">True</property>
+ <property name="shrink">True</property>
</packing>
</child>
</object>
<packing>
- <property name="resize">True</property>
- <property name="shrink">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="object_inspector_properties_tab">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="label" translatable="yes" context="developmenttool|properties">Properties</property>
+ </object>
+ <packing>
+ <property name="position">2</property>
+ <property name="tab-fill">False</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can-focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
<property name="shadow-type">in</property>
<child>
- <object class="GtkTextView" id="object_inspector_text_view">
- <property name="height-request">100</property>
+ <object class="GtkTreeView" id="methods_treeview_id">
<property name="visible">True</property>
<property name="can-focus">True</property>
- <property name="editable">False</property>
- <property name="wrap-mode">word</property>
- <property name="cursor-visible">False</property>
- <property name="accepts-tab">False</property>
- <property name="monospace">True</property>
+ <property name="receives-default">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="model">object_inspector_methods_liststore</property>
+ <property name="search-column">0</property>
+ <property name="enable-tree-lines">True</property>
+ <child>
+ <object class="GtkTreeViewColumn" id="methods_treeviewcolumn1">
+ <property name="resizable">True</property>
+ <property name="title" translatable="yes" context="developmenttool|method">Method</property>
+ <property name="clickable">True</property>
+ <property name="sort-indicator">True</property>
+ <property name="sort-column-id">0</property>
+ <child>
+ <object class="GtkCellRendererText" id="obj_insp_cellrenderertext10"/>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkTreeViewColumn" id="methods_treeviewcolumn2">
+ <property name="resizable">True</property>
+ <property name="title" translatable="yes" context="developmenttool|returntype">Return Type</property>
+ <property name="clickable">True</property>
+ <property name="sort-indicator">True</property>
+ <property name="sort-column-id">1</property>
+ <child>
+ <object class="GtkCellRendererText" id="obj_insp_cellrenderertext11"/>
+ <attributes>
+ <attribute name="text">1</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkTreeViewColumn" id="methods_treeviewcolumn3">
+ <property name="resizable">True</property>
+ <property name="title" translatable="yes" context="developmenttool|parameters">Parameters</property>
+ <property name="clickable">True</property>
+ <property name="sort-indicator">True</property>
+ <property name="sort-column-id">2</property>
+ <child>
+ <object class="GtkCellRendererText" id="obj_insp_cellrenderertext12"/>
+ <attributes>
+ <attribute name="text">2</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkTreeViewColumn" id="methods_treeviewcolumn4">
+ <property name="resizable">True</property>
+ <property name="title" translatable="yes" context="developmenttool|implementation_class">Implementation Class</property>
+ <property name="clickable">True</property>
+ <property name="sort-indicator">True</property>
+ <property name="sort-column-id">3</property>
+ <child>
+ <object class="GtkCellRendererText" id="obj_insp_cellrenderertext13"/>
+ <attributes>
+ <attribute name="text">3</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
</object>
</child>
</object>
<packing>
- <property name="resize">True</property>
- <property name="shrink">True</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="object_inspector_methods_tab">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="label" translatable="yes" context="developmenttool|methods">Methods</property>
+ </object>
+ <packing>
+ <property name="position">3</property>
+ <property name="tab-fill">False</property>
</packing>
</child>
</object>