sysprof: fix indent for non-expandable expanders

Instead of doing the indent depth trick that GtkTreeExpander does, this
changes the icon so that we keep the same indent size.
This commit is contained in:
Christian Hergert
2023-07-19 17:17:42 -07:00
parent 52513c3827
commit a990fc6b3c
4 changed files with 44 additions and 0 deletions

View File

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
height="16px"
viewBox="0 0 16 16"
width="16px"
version="1.1"
id="svg5033"
sodipodi:docname="threads-symbolic.svg"
inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs5037" />
<sodipodi:namedview
id="namedview5035"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
showgrid="false"
inkscape:zoom="51.007547"
inkscape:cx="7.1950137"
inkscape:cy="8.5771621"
inkscape:window-width="1551"
inkscape:window-height="1288"
inkscape:window-x="26"
inkscape:window-y="23"
inkscape:window-maximized="0"
inkscape:current-layer="svg5033" />
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -43,6 +43,9 @@ callgraphview symbol {
margin: -1px -3px;
padding: 1px 6px;
}
callgraphview treeexpander expander:not(.expandable) {
-gtk-icon-source: -gtk-icontheme("empty-symbolic");
}
callgraphview row:not(:selected) treeexpander expander:checked+box symbol.process,
callgraphview row:not(:selected) treeexpander expander:checked+box symbol.thread,
callgraphview row:not(:selected) treeexpander expander:checked+box symbol.root {

View File

@ -126,6 +126,11 @@ sysprof_tree_expander_update_icon (SysprofTreeExpander *self)
icon = self->icon;
gtk_widget_unset_state_flags (self->expander, GTK_STATE_FLAG_CHECKED);
}
if (gtk_tree_list_row_is_expandable (self->list_row))
gtk_widget_add_css_class (GTK_WIDGET (self->expander), "expandable");
else
gtk_widget_remove_css_class (GTK_WIDGET (self->expander), "expandable");
}
gtk_image_set_from_gicon (GTK_IMAGE (self->image), icon);

View File

@ -4,6 +4,7 @@
<file preprocess="xml-stripblanks">gtk/help-overlay.ui</file>
<file preprocess="xml-stripblanks">gtk/menus.ui</file>
<file preprocess="xml-stripblanks">icons/scalable/actions/address-layout-symbolic.svg</file>
<file preprocess="xml-stripblanks">icons/scalable/actions/empty-symbolic.svg</file>
<file preprocess="xml-stripblanks">icons/scalable/actions/mark-chart-symbolic.svg</file>
<file preprocess="xml-stripblanks">icons/scalable/actions/mark-table-symbolic.svg</file>
<file preprocess="xml-stripblanks">icons/scalable/actions/mark-waterfall-symbolic.svg</file>