mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-10 15:10:53 +00:00
libsysprof-analyze: make mark catalog work with sections
This allows us more flexibility with creating sections usin the flatten list model as the rows need to contain the data for the headers.
This commit is contained in:
@ -66,3 +66,7 @@ callgraphview row:not(:selected) treeexpander symbol.unwindable {
|
||||
marktable {
|
||||
font-size: .9em;
|
||||
}
|
||||
|
||||
markchart {
|
||||
font-size: .9em;
|
||||
}
|
||||
|
||||
@ -45,17 +45,6 @@ G_DEFINE_FINAL_TYPE (SysprofMarkChart, sysprof_mark_chart, GTK_TYPE_WIDGET)
|
||||
|
||||
static GParamSpec *properties [N_PROPS];
|
||||
|
||||
static GListModel *
|
||||
create_model_func (gpointer item,
|
||||
gpointer user_data)
|
||||
{
|
||||
if (SYSPROF_IS_MARK_CATALOG (item) &&
|
||||
sysprof_mark_catalog_get_kind (item) == SYSPROF_MARK_CATALOG_KIND_GROUP)
|
||||
return g_object_ref (item);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
sysprof_mark_chart_disconnect (SysprofMarkChart *self)
|
||||
{
|
||||
@ -70,7 +59,7 @@ sysprof_mark_chart_connect (SysprofMarkChart *self)
|
||||
{
|
||||
g_autoptr(GtkSingleSelection) single = NULL;
|
||||
GtkFilterListModel *filtered;
|
||||
GtkTreeListModel *marks_tree;
|
||||
GtkFlattenListModel *flatten;
|
||||
SysprofDocument *document;
|
||||
GtkSortListModel *sort_model;
|
||||
GtkSorter *column_sorter;
|
||||
@ -81,11 +70,8 @@ sysprof_mark_chart_connect (SysprofMarkChart *self)
|
||||
column_sorter = gtk_column_view_get_sorter (self->column_view);
|
||||
|
||||
document = sysprof_session_get_document (self->session);
|
||||
marks_tree = gtk_tree_list_model_new (sysprof_document_catalog_marks (document),
|
||||
FALSE, TRUE,
|
||||
create_model_func,
|
||||
NULL, NULL);
|
||||
filtered = gtk_filter_list_model_new (G_LIST_MODEL (marks_tree), NULL);
|
||||
flatten = gtk_flatten_list_model_new (sysprof_document_catalog_marks (document));
|
||||
filtered = gtk_filter_list_model_new (G_LIST_MODEL (flatten), NULL);
|
||||
g_object_bind_property (self->session, "filter", filtered, "filter", G_BINDING_SYNC_CREATE);
|
||||
sort_model = gtk_sort_list_model_new (G_LIST_MODEL (filtered), g_object_ref (column_sorter));
|
||||
single = gtk_single_selection_new (G_LIST_MODEL (sort_model));
|
||||
|
||||
@ -19,13 +19,14 @@
|
||||
<interface>
|
||||
<template class="GtkListHeader">
|
||||
<property name="child">
|
||||
<object class="GtkLabel">
|
||||
<object class="GtkInscription">
|
||||
<property name="xalign">0</property>
|
||||
<binding name="label">
|
||||
<lookup name="name" type="SysprofMarkCatalog">
|
||||
<lookup name="item" type="GtkTreeListRow">
|
||||
<lookup name="item">GtkListHeader</lookup>
|
||||
</lookup>
|
||||
<property name="nat-chars">40</property>
|
||||
<property name="min-chars">40</property>
|
||||
<property name="text-overflow">clip</property>
|
||||
<binding name="text">
|
||||
<lookup name="group" type="SysprofMarkCatalog">
|
||||
<lookup name="item">GtkListHeader</lookup>
|
||||
</lookup>
|
||||
</binding>
|
||||
</object>
|
||||
@ -38,6 +39,7 @@
|
||||
</property>
|
||||
<child>
|
||||
<object class="GtkColumnViewColumn" id="name_column">
|
||||
<property name="title" translatable="yes">Marks</property>
|
||||
<property name="factory">
|
||||
<object class="GtkBuilderListItemFactory">
|
||||
<property name="bytes"><![CDATA[
|
||||
@ -51,9 +53,7 @@
|
||||
<property name="max-width-chars">40</property>
|
||||
<binding name="label">
|
||||
<lookup name="name" type="SysprofMarkCatalog">
|
||||
<lookup name="item" type="GtkTreeListRow">
|
||||
<lookup name="item">GtkListItem</lookup>
|
||||
</lookup>
|
||||
<lookup name="item">GtkListItem</lookup>
|
||||
</lookup>
|
||||
</binding>
|
||||
</object>
|
||||
|
||||
Reference in New Issue
Block a user