mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
libsysprof-ui: start on new tabbed design
This commit is contained in:
@ -11,6 +11,7 @@
|
||||
|
||||
<file preprocess="xml-stripblanks">ui/sysprof-callgraph-view.ui</file>
|
||||
<file preprocess="xml-stripblanks">ui/sysprof-capture-view.ui</file>
|
||||
<file preprocess="xml-stripblanks">ui/sysprof-display.ui</file>
|
||||
<file preprocess="xml-stripblanks">ui/sysprof-details-view.ui</file>
|
||||
<file preprocess="xml-stripblanks">ui/sysprof-empty-state-view.ui</file>
|
||||
<file preprocess="xml-stripblanks">ui/sysprof-failed-state-view.ui</file>
|
||||
@ -18,6 +19,7 @@
|
||||
<file preprocess="xml-stripblanks">ui/sysprof-process-model-row.ui</file>
|
||||
<file preprocess="xml-stripblanks">ui/sysprof-profiler-menu-button.ui</file>
|
||||
<file preprocess="xml-stripblanks">ui/sysprof-recording-state-view.ui</file>
|
||||
<file preprocess="xml-stripblanks">ui/sysprof-tab.ui</file>
|
||||
<file preprocess="xml-stripblanks">ui/sysprof-visualizer-view.ui</file>
|
||||
</gresource>
|
||||
</gresources>
|
||||
|
||||
@ -3,6 +3,7 @@ libsysprof_ui_public_sources = [
|
||||
'sysprof-callgraph-view.c',
|
||||
'sysprof-color-cycle.c',
|
||||
'sysprof-cpu-visualizer-row.c',
|
||||
'sysprof-display.c',
|
||||
'sysprof-empty-state-view.c',
|
||||
'sysprof-failed-state-view.c',
|
||||
'sysprof-line-visualizer-row.c',
|
||||
@ -11,6 +12,7 @@ libsysprof_ui_public_sources = [
|
||||
'sysprof-mark-visualizer-row.c',
|
||||
'sysprof-model-filter.c',
|
||||
'sysprof-multi-paned.c',
|
||||
'sysprof-notebook.c',
|
||||
'sysprof-process-model-row.c',
|
||||
'sysprof-profiler-menu-button.c',
|
||||
'sysprof-recording-state-view.c',
|
||||
@ -27,6 +29,7 @@ libsysprof_ui_private_sources = [
|
||||
'sysprof-details-view.c',
|
||||
'sysprof-cell-renderer-duration.c',
|
||||
'sysprof-cell-renderer-percent.c',
|
||||
'sysprof-tab.c',
|
||||
'sysprof-theme-manager.c',
|
||||
'../stackstash.c',
|
||||
]
|
||||
@ -36,6 +39,7 @@ libsysprof_ui_public_headers = [
|
||||
'sysprof-callgraph-view.h',
|
||||
'sysprof-cell-renderer-percent.h',
|
||||
'sysprof-cpu-visualizer-row.h',
|
||||
'sysprof-display.h',
|
||||
'sysprof-empty-state-view.h',
|
||||
'sysprof-failed-state-view.h',
|
||||
'sysprof-line-visualizer-row.h',
|
||||
@ -44,6 +48,7 @@ libsysprof_ui_public_headers = [
|
||||
'sysprof-mark-visualizer-row.h',
|
||||
'sysprof-model-filter.h',
|
||||
'sysprof-multi-paned.h',
|
||||
'sysprof-notebook.h',
|
||||
'sysprof-process-model-row.h',
|
||||
'sysprof-profiler-menu-button.h',
|
||||
'sysprof-recording-state-view.h',
|
||||
|
||||
@ -226,7 +226,7 @@ sysprof_capture_view_scan_worker (GTask *task,
|
||||
SysprofCaptureReader *reader = task_data;
|
||||
SysprofCaptureFeatures features = {0};
|
||||
SysprofCaptureFrame frame;
|
||||
SysprofCaptureStat st_buf = {0};
|
||||
SysprofCaptureStat st_buf = {{0}};
|
||||
|
||||
g_assert (SYSPROF_IS_CAPTURE_VIEW (self));
|
||||
g_assert (G_IS_TASK (task));
|
||||
@ -775,3 +775,22 @@ sysprof_capture_view_fit_to_width (SysprofCaptureView *self)
|
||||
zoom = sysprof_zoom_manager_fit_zoom_for_duration (priv->zoom_manager, duration, width);
|
||||
sysprof_zoom_manager_set_zoom (priv->zoom_manager, zoom);
|
||||
}
|
||||
|
||||
/**
|
||||
* sysprof_capture_view_get_reader:
|
||||
*
|
||||
* Gets the reader for the view, if any.
|
||||
*
|
||||
* Returns: (transfer none): a #SysprofCaptureReader or %NULL
|
||||
*
|
||||
* Since: 3.34
|
||||
*/
|
||||
SysprofCaptureReader *
|
||||
sysprof_capture_view_get_reader (SysprofCaptureView *self)
|
||||
{
|
||||
SysprofCaptureViewPrivate *priv = sysprof_capture_view_get_instance_private (self);
|
||||
|
||||
g_return_val_if_fail (SYSPROF_IS_CAPTURE_VIEW (self), NULL);
|
||||
|
||||
return priv->reader;
|
||||
}
|
||||
|
||||
159
src/libsysprof-ui/sysprof-display.c
Normal file
159
src/libsysprof-ui/sysprof-display.c
Normal file
@ -0,0 +1,159 @@
|
||||
/* sysprof-display.c
|
||||
*
|
||||
* Copyright 2019 Christian Hergert <chergert@redhat.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
#define G_LOG_DOMAIN "sysprof-display"
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <glib/gi18n.h>
|
||||
|
||||
#include <sysprof-capture.h>
|
||||
#include <sysprof-ui.h>
|
||||
#include <sysprof.h>
|
||||
|
||||
#include "sysprof-capture-view.h"
|
||||
#include "sysprof-display.h"
|
||||
#include "sysprof-empty-state-view.h"
|
||||
#include "sysprof-recording-state-view.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
SysprofCaptureView *capture_view;
|
||||
SysprofEmptyStateView *empty_view;
|
||||
SysprofRecordingStateView *recording_view;
|
||||
} SysprofDisplayPrivate;
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE (SysprofDisplay, sysprof_display, GTK_TYPE_BIN)
|
||||
|
||||
enum {
|
||||
PROP_0,
|
||||
PROP_TITLE,
|
||||
N_PROPS
|
||||
};
|
||||
|
||||
static GParamSpec *properties [N_PROPS];
|
||||
|
||||
/**
|
||||
* sysprof_display_new:
|
||||
*
|
||||
* Create a new #SysprofDisplay.
|
||||
*
|
||||
* Returns: (transfer full): a newly created #SysprofDisplay
|
||||
*
|
||||
* Since: 3.34
|
||||
*/
|
||||
GtkWidget *
|
||||
sysprof_display_new (void)
|
||||
{
|
||||
return g_object_new (SYSPROF_TYPE_DISPLAY, NULL);
|
||||
}
|
||||
|
||||
static gchar *
|
||||
sysprof_display_dup_title (SysprofDisplay *self)
|
||||
{
|
||||
SysprofDisplayPrivate *priv = sysprof_display_get_instance_private (self);
|
||||
SysprofCaptureReader *reader;
|
||||
|
||||
g_return_val_if_fail (SYSPROF_IS_DISPLAY (self), NULL);
|
||||
|
||||
if ((reader = sysprof_capture_view_get_reader (priv->capture_view)))
|
||||
{
|
||||
const gchar *filename;
|
||||
|
||||
if ((filename = sysprof_capture_reader_get_filename (reader)))
|
||||
return g_strdup (filename);
|
||||
|
||||
}
|
||||
|
||||
return g_strdup (_("Unsaved Session"));
|
||||
}
|
||||
|
||||
static void
|
||||
sysprof_display_finalize (GObject *object)
|
||||
{
|
||||
G_OBJECT_CLASS (sysprof_display_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
sysprof_display_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
SysprofDisplay *self = (SysprofDisplay *)object;
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_TITLE:
|
||||
g_value_take_string (value, sysprof_display_dup_title (self));
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
sysprof_display_set_property (GObject *object,
|
||||
guint prop_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
switch (prop_id)
|
||||
{
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
sysprof_display_class_init (SysprofDisplayClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
|
||||
|
||||
object_class->finalize = sysprof_display_finalize;
|
||||
object_class->get_property = sysprof_display_get_property;
|
||||
object_class->set_property = sysprof_display_set_property;
|
||||
|
||||
properties [PROP_TITLE] =
|
||||
g_param_spec_string ("title",
|
||||
"Title",
|
||||
"The title of the display",
|
||||
NULL,
|
||||
(G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
|
||||
|
||||
g_object_class_install_properties (object_class, N_PROPS, properties);
|
||||
|
||||
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/sysprof/ui/sysprof-display.ui");
|
||||
gtk_widget_class_bind_template_child_private (widget_class, SysprofDisplay , empty_view);
|
||||
gtk_widget_class_bind_template_child_private (widget_class, SysprofDisplay , recording_view);
|
||||
gtk_widget_class_bind_template_child_private (widget_class, SysprofDisplay , capture_view);
|
||||
|
||||
g_type_ensure (SYSPROF_TYPE_CAPTURE_VIEW);
|
||||
g_type_ensure (SYSPROF_TYPE_EMPTY_STATE_VIEW);
|
||||
g_type_ensure (SYSPROF_TYPE_RECORDING_STATE_VIEW);
|
||||
}
|
||||
|
||||
static void
|
||||
sysprof_display_init (SysprofDisplay *self)
|
||||
{
|
||||
gtk_widget_init_template (GTK_WIDGET (self));
|
||||
}
|
||||
45
src/libsysprof-ui/sysprof-display.h
Normal file
45
src/libsysprof-ui/sysprof-display.h
Normal file
@ -0,0 +1,45 @@
|
||||
/* sysprof-display.h
|
||||
*
|
||||
* Copyright 2019 Christian Hergert <chergert@redhat.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "sysprof-version-macros.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define SYSPROF_TYPE_DISPLAY (sysprof_display_get_type())
|
||||
|
||||
SYSPROF_AVAILABLE_IN_ALL
|
||||
G_DECLARE_DERIVABLE_TYPE (SysprofDisplay, sysprof_display, SYSPROF, DISPLAY, GtkBin)
|
||||
|
||||
struct _SysprofDisplayClass
|
||||
{
|
||||
GtkBinClass parent_class;
|
||||
|
||||
/*< private >*/
|
||||
gpointer _reserved[16];
|
||||
} __attribute__((aligned(8)));
|
||||
|
||||
SYSPROF_AVAILABLE_IN_ALL
|
||||
GtkWidget *sysprof_display_new (void);
|
||||
|
||||
G_END_DECLS
|
||||
167
src/libsysprof-ui/sysprof-notebook.c
Normal file
167
src/libsysprof-ui/sysprof-notebook.c
Normal file
@ -0,0 +1,167 @@
|
||||
/* sysprof-notebook.c
|
||||
*
|
||||
* Copyright 2019 Christian Hergert <chergert@redhat.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
#define G_LOG_DOMAIN "sysprof-notebook"
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "sysprof-display.h"
|
||||
#include "sysprof-notebook.h"
|
||||
#include "sysprof-tab.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
void *dummy;
|
||||
} SysprofNotebookPrivate;
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE (SysprofNotebook, sysprof_notebook, GTK_TYPE_NOTEBOOK)
|
||||
|
||||
enum {
|
||||
PROP_0,
|
||||
N_PROPS
|
||||
};
|
||||
|
||||
static GParamSpec *properties [N_PROPS];
|
||||
|
||||
/**
|
||||
* sysprof_notebook_new:
|
||||
*
|
||||
* Create a new #SysprofNotebook.
|
||||
*
|
||||
* Returns: (transfer full): a newly created #SysprofNotebook
|
||||
*
|
||||
* Since: 3.34
|
||||
*/
|
||||
GtkWidget *
|
||||
sysprof_notebook_new (void)
|
||||
{
|
||||
return g_object_new (SYSPROF_TYPE_NOTEBOOK, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
sysprof_notebook_page_added (GtkNotebook *notebook,
|
||||
GtkWidget *child,
|
||||
guint page_num)
|
||||
{
|
||||
g_assert (SYSPROF_IS_NOTEBOOK (notebook));
|
||||
g_assert (GTK_IS_WIDGET (child));
|
||||
|
||||
if (SYSPROF_IS_DISPLAY (child))
|
||||
{
|
||||
GtkWidget *tab = sysprof_tab_new (SYSPROF_DISPLAY (child));
|
||||
|
||||
gtk_notebook_set_tab_label (notebook, child, tab);
|
||||
gtk_notebook_set_tab_reorderable (notebook, child, TRUE);
|
||||
}
|
||||
|
||||
gtk_notebook_set_show_tabs (notebook,
|
||||
gtk_notebook_get_n_pages (notebook) > 1);
|
||||
}
|
||||
|
||||
static void
|
||||
sysprof_notebook_page_removed (GtkNotebook *notebook,
|
||||
GtkWidget *child,
|
||||
guint page_num)
|
||||
{
|
||||
g_assert (SYSPROF_IS_NOTEBOOK (notebook));
|
||||
g_assert (GTK_IS_WIDGET (child));
|
||||
|
||||
if (gtk_notebook_get_n_pages (notebook) == 0)
|
||||
{
|
||||
child = sysprof_display_new ();
|
||||
gtk_container_add (GTK_CONTAINER (notebook), child);
|
||||
gtk_widget_show (child);
|
||||
}
|
||||
|
||||
gtk_notebook_set_show_tabs (notebook,
|
||||
gtk_notebook_get_n_pages (notebook) > 1);
|
||||
}
|
||||
|
||||
static void
|
||||
sysprof_notebook_finalize (GObject *object)
|
||||
{
|
||||
SysprofNotebook *self = (SysprofNotebook *)object;
|
||||
SysprofNotebookPrivate *priv = sysprof_notebook_get_instance_private (self);
|
||||
|
||||
G_OBJECT_CLASS (sysprof_notebook_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
sysprof_notebook_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
SysprofNotebook *self = SYSPROF_NOTEBOOK (object);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
sysprof_notebook_set_property (GObject *object,
|
||||
guint prop_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
SysprofNotebook *self = SYSPROF_NOTEBOOK (object);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
sysprof_notebook_class_init (SysprofNotebookClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
GtkNotebookClass *notebook_class = GTK_NOTEBOOK_CLASS (klass);
|
||||
|
||||
object_class->finalize = sysprof_notebook_finalize;
|
||||
object_class->get_property = sysprof_notebook_get_property;
|
||||
object_class->set_property = sysprof_notebook_set_property;
|
||||
|
||||
notebook_class->page_added = sysprof_notebook_page_added;
|
||||
notebook_class->page_removed = sysprof_notebook_page_removed;
|
||||
}
|
||||
|
||||
static void
|
||||
sysprof_notebook_init (SysprofNotebook *self)
|
||||
{
|
||||
gtk_notebook_set_show_border (GTK_NOTEBOOK (self), FALSE);
|
||||
gtk_notebook_set_scrollable (GTK_NOTEBOOK (self), TRUE);
|
||||
gtk_notebook_popup_enable (GTK_NOTEBOOK (self));
|
||||
}
|
||||
|
||||
void
|
||||
sysprof_notebook_close_current (SysprofNotebook *self)
|
||||
{
|
||||
gint page;
|
||||
|
||||
g_return_if_fail (SYSPROF_IS_NOTEBOOK (self));
|
||||
|
||||
if ((page = gtk_notebook_get_current_page (GTK_NOTEBOOK (self))) >= 0)
|
||||
gtk_widget_destroy (gtk_notebook_get_nth_page (GTK_NOTEBOOK (self), page));
|
||||
}
|
||||
47
src/libsysprof-ui/sysprof-notebook.h
Normal file
47
src/libsysprof-ui/sysprof-notebook.h
Normal file
@ -0,0 +1,47 @@
|
||||
/* sysprof-notebook.h
|
||||
*
|
||||
* Copyright 2019 Christian Hergert <chergert@redhat.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "sysprof-version-macros.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define SYSPROF_TYPE_NOTEBOOK (sysprof_notebook_get_type())
|
||||
|
||||
SYSPROF_AVAILABLE_IN_ALL
|
||||
G_DECLARE_DERIVABLE_TYPE (SysprofNotebook, sysprof_notebook, SYSPROF, NOTEBOOK, GtkNotebook)
|
||||
|
||||
struct _SysprofNotebookClass
|
||||
{
|
||||
GtkNotebookClass parent_class;
|
||||
|
||||
/*< private >*/
|
||||
gpointer _reserved[16];
|
||||
};
|
||||
|
||||
SYSPROF_AVAILABLE_IN_ALL
|
||||
GtkWidget *sysprof_notebook_new (void);
|
||||
SYSPROF_AVAILABLE_IN_ALL
|
||||
void sysprof_notebook_close_current (SysprofNotebook *self);
|
||||
|
||||
G_END_DECLS
|
||||
152
src/libsysprof-ui/sysprof-tab.c
Normal file
152
src/libsysprof-ui/sysprof-tab.c
Normal file
@ -0,0 +1,152 @@
|
||||
/* sysprof-tab.c
|
||||
*
|
||||
* Copyright 2019 Christian Hergert <chergert@redhat.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
#define G_LOG_DOMAIN "sysprof-tab"
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "sysprof-display.h"
|
||||
#include "sysprof-tab.h"
|
||||
|
||||
struct _SysprofTab
|
||||
{
|
||||
GtkBox parent_instance;
|
||||
|
||||
GtkButton *close_button;
|
||||
GtkLabel *title;
|
||||
|
||||
SysprofDisplay *display;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (SysprofTab, sysprof_tab, GTK_TYPE_BOX)
|
||||
|
||||
enum {
|
||||
PROP_0,
|
||||
PROP_DISPLAY,
|
||||
N_PROPS
|
||||
};
|
||||
|
||||
static GParamSpec *properties [N_PROPS];
|
||||
|
||||
GtkWidget *
|
||||
sysprof_tab_new (SysprofDisplay *display)
|
||||
{
|
||||
return g_object_new (SYSPROF_TYPE_TAB,
|
||||
"display", display,
|
||||
NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
sysprof_tab_close_clicked (SysprofTab *self,
|
||||
GtkButton *button)
|
||||
{
|
||||
g_assert (SYSPROF_IS_TAB (self));
|
||||
g_assert (GTK_IS_BUTTON (button));
|
||||
|
||||
if (self->display != NULL)
|
||||
gtk_widget_destroy (GTK_WIDGET (self->display));
|
||||
}
|
||||
|
||||
static void
|
||||
sysprof_tab_finalize (GObject *object)
|
||||
{
|
||||
SysprofTab *self = (SysprofTab *)object;
|
||||
|
||||
g_clear_weak_pointer (&self->display);
|
||||
|
||||
G_OBJECT_CLASS (sysprof_tab_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
sysprof_tab_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
SysprofTab *self = SYSPROF_TAB (object);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_DISPLAY:
|
||||
g_value_set_object (value, self->display);
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
sysprof_tab_set_property (GObject *object,
|
||||
guint prop_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
SysprofTab *self = SYSPROF_TAB (object);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_DISPLAY:
|
||||
g_set_weak_pointer (&self->display, g_value_get_object (value));
|
||||
g_object_bind_property (self->display, "title",
|
||||
self->title, "label",
|
||||
G_BINDING_SYNC_CREATE);
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
sysprof_tab_class_init (SysprofTabClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
|
||||
|
||||
object_class->finalize = sysprof_tab_finalize;
|
||||
object_class->get_property = sysprof_tab_get_property;
|
||||
object_class->set_property = sysprof_tab_set_property;
|
||||
|
||||
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/sysprof/ui/sysprof-tab.ui");
|
||||
gtk_widget_class_bind_template_child (widget_class, SysprofTab, close_button);
|
||||
gtk_widget_class_bind_template_child (widget_class, SysprofTab, title);
|
||||
|
||||
properties [PROP_DISPLAY] =
|
||||
g_param_spec_object ("display",
|
||||
"Display",
|
||||
"The display widget for the tab",
|
||||
SYSPROF_TYPE_DISPLAY,
|
||||
(G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS));
|
||||
|
||||
g_object_class_install_properties (object_class, N_PROPS, properties);
|
||||
}
|
||||
|
||||
static void
|
||||
sysprof_tab_init (SysprofTab *self)
|
||||
{
|
||||
gtk_widget_init_template (GTK_WIDGET (self));
|
||||
|
||||
g_signal_connect_object (self->close_button,
|
||||
"clicked",
|
||||
G_CALLBACK (sysprof_tab_close_clicked),
|
||||
self,
|
||||
G_CONNECT_SWAPPED);
|
||||
}
|
||||
35
src/libsysprof-ui/sysprof-tab.h
Normal file
35
src/libsysprof-ui/sysprof-tab.h
Normal file
@ -0,0 +1,35 @@
|
||||
/* sysprof-tab.h
|
||||
*
|
||||
* Copyright 2019 Christian Hergert <chergert@redhat.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "sysprof-display.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define SYSPROF_TYPE_TAB (sysprof_tab_get_type())
|
||||
|
||||
G_DECLARE_FINAL_TYPE (SysprofTab, sysprof_tab, SYSPROF, TAB, GtkBox)
|
||||
|
||||
GtkWidget *sysprof_tab_new (SysprofDisplay *display);
|
||||
|
||||
G_END_DECLS
|
||||
@ -30,6 +30,7 @@ G_BEGIN_DECLS
|
||||
# include "sysprof-capture-view.h"
|
||||
# include "sysprof-cell-renderer-percent.h"
|
||||
# include "sysprof-cpu-visualizer-row.h"
|
||||
# include "sysprof-display.h"
|
||||
# include "sysprof-empty-state-view.h"
|
||||
# include "sysprof-failed-state-view.h"
|
||||
# include "sysprof-line-visualizer-row.h"
|
||||
@ -38,6 +39,7 @@ G_BEGIN_DECLS
|
||||
# include "sysprof-mark-visualizer-row.h"
|
||||
# include "sysprof-model-filter.h"
|
||||
# include "sysprof-multi-paned.h"
|
||||
# include "sysprof-notebook.h"
|
||||
# include "sysprof-process-model-row.h"
|
||||
# include "sysprof-profiler-menu-button.h"
|
||||
# include "sysprof-recording-state-view.h"
|
||||
|
||||
37
src/libsysprof-ui/ui/sysprof-display.ui
Normal file
37
src/libsysprof-ui/ui/sysprof-display.ui
Normal file
@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<template class="SysprofDisplay" parent="GtkBin">
|
||||
<child>
|
||||
<object class="GtkStack" id="stack">
|
||||
<property name="homogeneous">false</property>
|
||||
<property name="visible">true</property>
|
||||
<child>
|
||||
<object class="SysprofEmptyStateView" id="empty_view">
|
||||
<property name="title" translatable="yes">Welcome to Sysprof</property>
|
||||
<property name="subtitle" translatable="yes">Start profiling your system with the <b>Record</b> button above.</property>
|
||||
<property name="visible">true</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="name">empty</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="SysprofCaptureView" id="capture_view">
|
||||
<property name="visible">true</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="name">capture</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="SysprofRecordingStateView" id="recording_view">
|
||||
<property name="visible">true</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="name">recording</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</template>
|
||||
</interface>
|
||||
45
src/libsysprof-ui/ui/sysprof-tab.ui
Normal file
45
src/libsysprof-ui/ui/sysprof-tab.ui
Normal file
@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.22.0 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.0"/>
|
||||
<template class="SysprofTab" parent="GtkBox">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="hexpand">False</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="title">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="hexpand">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="close_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="receives_default">False</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="icon_name">window-close-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<style>
|
||||
<class name="flat"/>
|
||||
<class name="small-button"/>
|
||||
</style>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</template>
|
||||
</interface>
|
||||
@ -36,9 +36,20 @@ struct {
|
||||
const gchar *action_name;
|
||||
const gchar *accels[12];
|
||||
} default_accels[] = {
|
||||
{ "zoom.zoom-in", { "<Primary>plus", "<Primary>KP_Add", "<Primary>equal", "ZoomIn", NULL } },
|
||||
{ "zoom.zoom-out", { "<Primary>minus", "<Primary>KP_Subtract", "ZoomOut", NULL } },
|
||||
{ "zoom.zoom-one", { "<Primary>0", "<Primary>KP_0", NULL } },
|
||||
{ "zoom.zoom-in", { "<Primary>plus", "<Primary>KP_Add", "<Primary>equal", "ZoomIn", NULL } },
|
||||
{ "zoom.zoom-out", { "<Primary>minus", "<Primary>KP_Subtract", "ZoomOut", NULL } },
|
||||
{ "zoom.zoom-one", { "<Primary>0", "<Primary>KP_0", NULL } },
|
||||
{ "win.new-tab", { "<Primary>t", NULL } },
|
||||
{ "win.close-tab", { "<Primary>w", NULL } },
|
||||
{ "win.switch-tab(1)", { "<Alt>1", NULL } },
|
||||
{ "win.switch-tab(2)", { "<Alt>2", NULL } },
|
||||
{ "win.switch-tab(3)", { "<Alt>3", NULL } },
|
||||
{ "win.switch-tab(4)", { "<Alt>4", NULL } },
|
||||
{ "win.switch-tab(5)", { "<Alt>5", NULL } },
|
||||
{ "win.switch-tab(6)", { "<Alt>6", NULL } },
|
||||
{ "win.switch-tab(7)", { "<Alt>7", NULL } },
|
||||
{ "win.switch-tab(8)", { "<Alt>8", NULL } },
|
||||
{ "win.switch-tab(9)", { "<Alt>9", NULL } },
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
@ -70,29 +81,23 @@ sysprof_application_activate (GApplication *app)
|
||||
|
||||
static void
|
||||
sysprof_application_open (GApplication *app,
|
||||
GFile **files,
|
||||
gint n_files,
|
||||
const gchar *hint)
|
||||
GFile **files,
|
||||
gint n_files,
|
||||
const gchar *hint)
|
||||
{
|
||||
guint opened = 0;
|
||||
gint i;
|
||||
GtkWidget *window;
|
||||
|
||||
g_assert (SYSPROF_IS_APPLICATION (app));
|
||||
g_assert (files != NULL || n_files == 0);
|
||||
|
||||
for (i = 0; i < n_files; i++)
|
||||
{
|
||||
SysprofWindow *window;
|
||||
window = sysprof_window_new (SYSPROF_APPLICATION (app));
|
||||
|
||||
window = g_object_new (SYSPROF_TYPE_WINDOW,
|
||||
"application", app,
|
||||
NULL);
|
||||
sysprof_window_open (window, files [i]);
|
||||
gtk_window_present (GTK_WINDOW (window));
|
||||
opened++;
|
||||
}
|
||||
for (gint i = 0; i < n_files; i++)
|
||||
sysprof_window_open (SYSPROF_WINDOW (window), files[i]);
|
||||
|
||||
if (opened == 0)
|
||||
gtk_window_present (GTK_WINDOW (window));
|
||||
|
||||
if (n_files == 0)
|
||||
sysprof_application_activate (app);
|
||||
}
|
||||
|
||||
@ -246,7 +251,6 @@ sysprof_open_capture (GSimpleAction *action,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkApplication *app = user_data;
|
||||
GtkWidget *window;
|
||||
GList *list;
|
||||
|
||||
g_assert (G_IS_APPLICATION (app));
|
||||
@ -257,29 +261,11 @@ sysprof_open_capture (GSimpleAction *action,
|
||||
|
||||
for (; list != NULL; list = list->next)
|
||||
{
|
||||
window = list->data;
|
||||
GtkWindow *window = list->data;
|
||||
|
||||
if (SYSPROF_IS_WINDOW (window))
|
||||
{
|
||||
SysprofWindowState state;
|
||||
|
||||
state = sysprof_window_get_state (SYSPROF_WINDOW (window));
|
||||
|
||||
if (state == SYSPROF_WINDOW_STATE_EMPTY)
|
||||
{
|
||||
sysprof_window_open_from_dialog (SYSPROF_WINDOW (window));
|
||||
return;
|
||||
}
|
||||
}
|
||||
sysprof_window_open_from_dialog (SYSPROF_WINDOW (window));
|
||||
}
|
||||
|
||||
window = g_object_new (SYSPROF_TYPE_WINDOW,
|
||||
"application", app,
|
||||
NULL);
|
||||
|
||||
gtk_window_present (GTK_WINDOW (window));
|
||||
|
||||
sysprof_window_open_from_dialog (SYSPROF_WINDOW (window));
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
/* sysprof-window.h
|
||||
*
|
||||
* Copyright 2016 Christian Hergert <chergert@redhat.com>
|
||||
* Copyright 2016-2019 Christian Hergert <chergert@redhat.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -14,39 +14,26 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
#ifndef SYSPROF_WINDOW_H
|
||||
#define SYSPROF_WINDOW_H
|
||||
#pragma once
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "sysprof-application.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define SYSPROF_TYPE_WINDOW (sysprof_window_get_type())
|
||||
|
||||
G_DECLARE_FINAL_TYPE (SysprofWindow, sysprof_window, SYSPROF, WINDOW, GtkApplicationWindow)
|
||||
|
||||
typedef enum
|
||||
{
|
||||
SYSPROF_WINDOW_STATE_0,
|
||||
SYSPROF_WINDOW_STATE_EMPTY,
|
||||
SYSPROF_WINDOW_STATE_FAILED,
|
||||
SYSPROF_WINDOW_STATE_RECORDING,
|
||||
SYSPROF_WINDOW_STATE_PROCESSING,
|
||||
SYSPROF_WINDOW_STATE_BROWSING,
|
||||
} SysprofWindowState;
|
||||
|
||||
SysprofWindowState sysprof_window_get_state (SysprofWindow *self);
|
||||
gboolean sysprof_window_get_recording (SysprofWindow *self);
|
||||
GFile *sysprof_window_get_capture_file (SysprofWindow *self);
|
||||
void sysprof_window_set_capture_file (SysprofWindow *self,
|
||||
GFile *capture_file);
|
||||
void sysprof_window_open (SysprofWindow *self,
|
||||
GFile *file);
|
||||
void sysprof_window_open_from_dialog (SysprofWindow *self);
|
||||
GtkWidget *sysprof_window_new (SysprofApplication *application);
|
||||
void sysprof_window_new_tab (SysprofWindow *self);
|
||||
void sysprof_window_open (SysprofWindow *self,
|
||||
GFile *file);
|
||||
void sysprof_window_open_from_dialog (SysprofWindow *self);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* SYSPROF_WINDOW_H */
|
||||
|
||||
|
||||
@ -70,296 +70,17 @@
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuButton" id="gear_menu_button">
|
||||
<property name="popover">gear_popover</property>
|
||||
<property name="visible">true</property>
|
||||
<style>
|
||||
<class name="image-button"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="icon-name">open-menu-symbolic</property>
|
||||
<property name="visible">true</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="pack-type">end</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<object class="SysprofNotebook" id="notebook">
|
||||
<property name="visible">true</property>
|
||||
<child>
|
||||
<object class="GtkRevealer" id="info_bar_revealer">
|
||||
<object class="SysprofDisplay">
|
||||
<property name="visible">true</property>
|
||||
<property name="reveal-child">false</property>
|
||||
<child>
|
||||
<object class="GtkInfoBar" id="info_bar">
|
||||
<property name="visible">true</property>
|
||||
<child internal-child="content_area">
|
||||
<object class="GtkBox">
|
||||
<child>
|
||||
<object class="GtkLabel" id="info_bar_label">
|
||||
<property name="hexpand">true</property>
|
||||
<property name="label">Failure</property>
|
||||
<property name="visible">true</property>
|
||||
<property name="wrap">true</property>
|
||||
<property name="xalign">0</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="close_info_button">
|
||||
<property name="label" translatable="yes" comments="Translators: This is a button.">_Close</property>
|
||||
<property name="use-underline">true</property>
|
||||
<property name="visible">true</property>
|
||||
<property name="width-request">100</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<action-widgets>
|
||||
<action-widget response="0">close_info_button</action-widget>
|
||||
</action-widgets>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkStack" id="view_stack">
|
||||
<property name="expand">true</property>
|
||||
<property name="transition-duration">400</property>
|
||||
<property name="transition-type">crossfade</property>
|
||||
<property name="visible">true</property>
|
||||
<child>
|
||||
<object class="SysprofEmptyStateView" id="empty_view">
|
||||
<property name="visible">true</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="name">empty</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="SysprofFailedStateView" id="failed_view">
|
||||
<property name="visible">true</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="name">failed</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="SysprofRecordingStateView" id="recording_view">
|
||||
<property name="visible">true</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="name">recording</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="SysprofMultiPaned" id="paned">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="visible">true</property>
|
||||
<property name="vexpand">true</property>
|
||||
<child>
|
||||
<object class="SysprofVisualizerView" id="visualizers">
|
||||
<property name="visible">true</property>
|
||||
<property name="zoom-manager">zoom_manager</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkNotebook" id="notebook">
|
||||
<property name="vexpand">true</property>
|
||||
<property name="visible">true</property>
|
||||
<child>
|
||||
<object class="SysprofCallgraphView" id="callgraph_view">
|
||||
<property name="visible">true</property>
|
||||
<property name="vexpand">true</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="tab-label" translatable="yes">Callgraph</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="SysprofMarksView" id="marks_view">
|
||||
<property name="visible">true</property>
|
||||
<property name="vexpand">true</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="tab-label" translatable="yes">Marks</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="name">browsing</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</template>
|
||||
<object class="SysprofZoomManager" id="zoom_manager">
|
||||
<property name="min-zoom">0.01</property>
|
||||
</object>
|
||||
<object class="GtkPopover" id="gear_popover">
|
||||
<property name="border-width">12</property>
|
||||
<property name="width-request">225</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="visible">true</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="hexpand">true</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
<property name="visible">true</property>
|
||||
<style>
|
||||
<class name="linked"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="action-name">zoom.zoom-out</property>
|
||||
<property name="hexpand">true</property>
|
||||
<property name="tooltip-text" translatable="yes" comments="Translators: This is a tooltip.">Zoom out (Ctrl+-)</property>
|
||||
<property name="visible">true</property>
|
||||
<style>
|
||||
<class name="image-button"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="icon-name">zoom-out-symbolic</property>
|
||||
<property name="visible">true</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="action-name">zoom.zoom-one</property>
|
||||
<property name="tooltip-text" translatable="yes" comments="Translators: This is a tooltip.">Reset zoom level (Ctrl+0)</property>
|
||||
<property name="visible">true</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="zoom_one_label">
|
||||
<property name="width-chars">5</property>
|
||||
<property name="visible">true</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="action-name">zoom.zoom-in</property>
|
||||
<property name="hexpand">true</property>
|
||||
<property name="tooltip-text" translatable="yes" comments="Translators: This is a tooltip.">Zoom in (Ctrl++)</property>
|
||||
<property name="visible">true</property>
|
||||
<style>
|
||||
<class name="image-button"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="icon-name">zoom-in-symbolic</property>
|
||||
<property name="visible">true</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator">
|
||||
<property name="orientation">horizontal</property>
|
||||
<property name="margin-top">6</property>
|
||||
<property name="visible">true</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="action-name">app.new-window</property>
|
||||
<property name="text" translatable="yes" comments="Translators: This is a menu label.">New Window</property>
|
||||
<property name="visible">true</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator">
|
||||
<property name="orientation">horizontal</property>
|
||||
<property name="visible">true</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="action-name">win.open-capture</property>
|
||||
<property name="text" translatable="yes" context="menu label" comments="Translators: This is a menu label.">Open Capture…</property>
|
||||
<property name="visible">true</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="action-name">win.save-capture</property>
|
||||
<property name="text" translatable="yes" comments="Translators: This is a menu label.">Save As…</property>
|
||||
<property name="visible">true</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator">
|
||||
<property name="orientation">horizontal</property>
|
||||
<property name="visible">true</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="action-name">win.screenshot</property>
|
||||
<property name="text" translatable="yes" comments="Translators: This is a menu label.">Screenshot</property>
|
||||
<property name="visible">true</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator">
|
||||
<property name="orientation">horizontal</property>
|
||||
<property name="visible">true</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="action-name">win.close-capture</property>
|
||||
<property name="text" translatable="yes" comments="Translators: This is a menu label.">Close</property>
|
||||
<property name="visible">true</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator">
|
||||
<property name="orientation">horizontal</property>
|
||||
<property name="visible">true</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="action-name">app.show-help-overlay</property>
|
||||
<property name="text" translatable="yes">Keyboard Shortcuts</property>
|
||||
<property name="visible">true</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="action-name">app.help</property>
|
||||
<property name="text" translatable="yes">Help</property>
|
||||
<property name="visible">true</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkModelButton">
|
||||
<property name="action-name">app.about</property>
|
||||
<property name="text" translatable="yes">About Sysprof</property>
|
||||
<property name="visible">true</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
|
||||
Reference in New Issue
Block a user