inspector: Drop the button path

The button path takes up quite a bit of room, and is not _that_
useful. If this information is useful, it can find a new home
on the misc tab.
This commit is contained in:
Matthias Clasen 2014-10-10 15:52:48 -04:00
parent 2f833d4f44
commit 4222e8d713
10 changed files with 0 additions and 218 deletions

View File

@ -19,8 +19,6 @@ libgtkinspector_la_SOURCES = \
action-editor.c \ action-editor.c \
actions.h \ actions.h \
actions.c \ actions.c \
button-path.h \
button-path.c \
classes-list.h \ classes-list.h \
classes-list.c \ classes-list.c \
css-editor.h \ css-editor.h \
@ -95,7 +93,6 @@ libgtkinspector_la_LDFLAGS = \
templates = \ templates = \
actions.ui \ actions.ui \
button-path.ui \
classes-list.ui \ classes-list.ui \
css-editor.ui \ css-editor.ui \
data-list.ui \ data-list.ui \

View File

@ -1,86 +0,0 @@
/*
* Copyright (c) 2013 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "config.h"
#include <glib/gi18n-lib.h>
#include "button-path.h"
#include "gtkbutton.h"
#include "gtkwidgetpath.h"
struct _GtkInspectorButtonPathPrivate
{
GtkWidget *sw;
GtkWidget *button_box;
};
G_DEFINE_TYPE_WITH_PRIVATE (GtkInspectorButtonPath, gtk_inspector_button_path, GTK_TYPE_BOX)
static void
gtk_inspector_button_path_init (GtkInspectorButtonPath *bp)
{
bp->priv = gtk_inspector_button_path_get_instance_private (bp);
gtk_widget_init_template (GTK_WIDGET (bp));
}
static void
gtk_inspector_button_path_class_init (GtkInspectorButtonPathClass *klass)
{
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
gtk_widget_class_set_template_from_resource (widget_class, "/org/gtk/inspector/button-path.ui");
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorButtonPath, sw);
gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorButtonPath, button_box);
}
void
gtk_inspector_button_path_set_object (GtkInspectorButtonPath *bp,
GObject *object)
{
GtkContainer *box = GTK_CONTAINER (bp->priv->button_box);
GtkWidget *b;
gtk_container_foreach (box, (GtkCallback)gtk_widget_destroy, NULL);
if (GTK_IS_WIDGET (object))
{
GtkWidget *widget = GTK_WIDGET (object);
gchar *path, **words;
gint i;
path = gtk_widget_path_to_string (gtk_widget_get_path (widget));
words = g_strsplit (path, " ", 0);
for (i = 0; i < g_strv_length (words); i++)
{
b = gtk_button_new_with_label (words[i]);
gtk_widget_show (b);
gtk_container_add (box, b);
}
g_strfreev (words);
g_free (path);
}
}
// vim: set et sw=2 ts=2:

View File

@ -1,61 +0,0 @@
/*
* Copyright (c) 2013 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef _GTK_INSPECTOR_BUTTON_PATH_H_
#define _GTK_INSPECTOR_BUTTON_PATH_H_
#include <gtk/gtkbox.h>
#define GTK_TYPE_INSPECTOR_BUTTON_PATH (gtk_inspector_button_path_get_type())
#define GTK_INSPECTOR_BUTTON_PATH(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GTK_TYPE_INSPECTOR_BUTTON_PATH, GtkInspectorButtonPath))
#define GTK_INSPECTOR_BUTTON_PATH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GTK_TYPE_INSPECTOR_BUTTON_PATH, GtkInspectorButtonPathClass))
#define GTK_INSPECTOR_IS_BUTTON_PATH(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GTK_TYPE_INSPECTOR_BUTTON_PATH))
#define GTK_INSPECTOR_IS_BUTTON_PATH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GTK_TYPE_INSPECTOR_BUTTON_PATH))
#define GTK_INSPECTOR_BUTTON_PATH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GTK_TYPE_INSPECTOR_BUTTON_PATH, GtkInspectorButtonPathClass))
typedef struct _GtkInspectorButtonPathPrivate GtkInspectorButtonPathPrivate;
typedef struct _GtkInspectorButtonPath
{
GtkBox parent;
GtkInspectorButtonPathPrivate *priv;
} GtkInspectorButtonPath;
typedef struct _GtkInspectorButtonPathClass
{
GtkBoxClass parent;
} GtkInspectorButtonPathClass;
G_BEGIN_DECLS
GType gtk_inspector_button_path_get_type (void);
void gtk_inspector_button_path_set_object (GtkInspectorButtonPath *bp,
GObject *object);
G_END_DECLS
#endif // _GTK_INSPECTOR_BUTTON_PATH_H_
// vim: set et sw=2 ts=2:

View File

@ -1,55 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface domain="gtk30">
<template class="GtkInspectorButtonPath" parent="GtkBox">
<property name="orientation">horizontal</property>
<child>
<object class="GtkScrolledWindow" id="sw">
<property name="visible">True</property>
<property name="hscrollbar-policy">automatic</property>
<property name="vscrollbar-policy">never</property>
<property name="hexpand">True</property>
<child>
<object class="GtkBox">
<property name="orientation">horizontal</property>
<property name="visible">True</property>
<property name="halign">start</property>
<child>
<object class="GtkButton" id="placeholder">
<property name="margin">6</property>
<property name="label">X</property>
</object>
</child>
<child>
<object class="GtkBox" id="button_box">
<property name="orientation">horizontal</property>
<property name="visible">True</property>
<property name="hexpand">True</property>
<property name="margin">6</property>
<property name="spacing">0</property>
<style>
<class name="linked"/>
</style>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="label" translatable="yes">Choose a widget through the inspector</property>
<property name="hexpand">True</property>
<property name="xalign">0.5</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</template>
<object class="GtkSizeGroup">
<property name="mode">vertical</property>
<property name="ignore-hidden">False</property>
<widgets>
<widget name="placeholder"/>
<widget name="button_box"/>
</widgets>
</object>
</interface>

View File

@ -1 +0,0 @@
N_("Choose a widget through the inspector");

View File

@ -25,7 +25,6 @@
#include "init.h" #include "init.h"
#include "actions.h" #include "actions.h"
#include "button-path.h"
#include "classes-list.h" #include "classes-list.h"
#include "css-editor.h" #include "css-editor.h"
#include "data-list.h" #include "data-list.h"
@ -56,7 +55,6 @@ gtk_inspector_init (void)
gtk_inspector_register_resource (); gtk_inspector_register_resource ();
g_type_ensure (GTK_TYPE_INSPECTOR_ACTIONS); g_type_ensure (GTK_TYPE_INSPECTOR_ACTIONS);
g_type_ensure (GTK_TYPE_INSPECTOR_BUTTON_PATH);
g_type_ensure (GTK_TYPE_INSPECTOR_CLASSES_LIST); g_type_ensure (GTK_TYPE_INSPECTOR_CLASSES_LIST);
g_type_ensure (GTK_TYPE_INSPECTOR_CSS_EDITOR); g_type_ensure (GTK_TYPE_INSPECTOR_CSS_EDITOR);
g_type_ensure (GTK_TYPE_INSPECTOR_DATA_LIST); g_type_ensure (GTK_TYPE_INSPECTOR_DATA_LIST);

View File

@ -2,7 +2,6 @@
<gresources> <gresources>
<gresource prefix="/org/gtk/inspector"> <gresource prefix="/org/gtk/inspector">
<file compressed="true">actions.ui</file> <file compressed="true">actions.ui</file>
<file compressed="true">button-path.ui</file>
<file compressed="true">classes-list.ui</file> <file compressed="true">classes-list.ui</file>
<file compressed="true">css-editor.ui</file> <file compressed="true">css-editor.ui</file>
<file compressed="true">data-list.ui</file> <file compressed="true">data-list.ui</file>

View File

@ -35,7 +35,6 @@
#include "widget-tree.h" #include "widget-tree.h"
#include "python-hooks.h" #include "python-hooks.h"
#include "python-shell.h" #include "python-shell.h"
#include "button-path.h"
#include "size-groups.h" #include "size-groups.h"
#include "style-prop-list.h" #include "style-prop-list.h"
#include "data-list.h" #include "data-list.h"
@ -79,7 +78,6 @@ on_widget_tree_selection_changed (GtkInspectorWidgetTree *wt,
gtk_inspector_signals_list_set_object (GTK_INSPECTOR_SIGNALS_LIST (iw->signals_list), selected); gtk_inspector_signals_list_set_object (GTK_INSPECTOR_SIGNALS_LIST (iw->signals_list), selected);
gtk_inspector_object_hierarchy_set_object (GTK_INSPECTOR_OBJECT_HIERARCHY (iw->object_hierarchy), selected); gtk_inspector_object_hierarchy_set_object (GTK_INSPECTOR_OBJECT_HIERARCHY (iw->object_hierarchy), selected);
gtk_inspector_misc_info_set_object (GTK_INSPECTOR_MISC_INFO (iw->misc_info), selected); gtk_inspector_misc_info_set_object (GTK_INSPECTOR_MISC_INFO (iw->misc_info), selected);
gtk_inspector_button_path_set_object (GTK_INSPECTOR_BUTTON_PATH (iw->button_path), selected);
gtk_inspector_classes_list_set_object (GTK_INSPECTOR_CLASSES_LIST (iw->classes_list), selected); gtk_inspector_classes_list_set_object (GTK_INSPECTOR_CLASSES_LIST (iw->classes_list), selected);
gtk_inspector_css_editor_set_object (GTK_INSPECTOR_CSS_EDITOR (iw->widget_css_editor), selected); gtk_inspector_css_editor_set_object (GTK_INSPECTOR_CSS_EDITOR (iw->widget_css_editor), selected);
gtk_inspector_size_groups_set_object (GTK_INSPECTOR_SIZE_GROUPS (iw->size_groups), selected); gtk_inspector_size_groups_set_object (GTK_INSPECTOR_SIZE_GROUPS (iw->size_groups), selected);
@ -177,7 +175,6 @@ gtk_inspector_window_class_init (GtkInspectorWindowClass *klass)
gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, prop_list); gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, prop_list);
gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, child_prop_list); gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, child_prop_list);
gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, signals_list); gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, signals_list);
gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, button_path);
gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, classes_list); gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, classes_list);
gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, style_prop_list); gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, style_prop_list);
gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, widget_css_editor); gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, widget_css_editor);

View File

@ -48,7 +48,6 @@ typedef struct
GtkWidget *signals_list; GtkWidget *signals_list;
GtkWidget *style_prop_list; GtkWidget *style_prop_list;
GtkWidget *python_shell; GtkWidget *python_shell;
GtkWidget *button_path;
GtkWidget *classes_list; GtkWidget *classes_list;
GtkWidget *widget_css_editor; GtkWidget *widget_css_editor;
GtkWidget *object_hierarchy; GtkWidget *object_hierarchy;

View File

@ -52,11 +52,6 @@
<object class="GtkBox"> <object class="GtkBox">
<property name="visible">True</property> <property name="visible">True</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<child>
<object class="GtkInspectorButtonPath" id="button_path">
<property name="visible">True</property>
</object>
</child>
<child> <child>
<object class="GtkPaned"> <object class="GtkPaned">
<property name="visible">True</property> <property name="visible">True</property>