[gnome-notes/revert-9acd1718] Revert "Add indent and outdent buttons to editor toolbar"
- From: Isaque Galdino de Araujo <igaldino src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-notes/revert-9acd1718] Revert "Add indent and outdent buttons to editor toolbar"
- Date: Fri, 5 Mar 2021 17:15:06 +0000 (UTC)
commit 45244bfb2bca4db3336d7d2879d219b95f253a38
Author: Isaque Galdino de Araujo <igaldino gmail com>
Date: Fri Mar 5 17:15:05 2021 +0000
Revert "Add indent and outdent buttons to editor toolbar"
This reverts commit 9acd1718dde76c911893872caa55172e73697d23
data/resources/editor-toolbar.ui | 56 ---------------------------------
src/bjb-editor-toolbar.c | 24 --------------
src/libbiji/biji-note-obj.h | 4 +--
src/libbiji/editor/biji-webkit-editor.c | 22 +------------
4 files changed, 2 insertions(+), 104 deletions(-)
---
diff --git a/data/resources/editor-toolbar.ui b/data/resources/editor-toolbar.ui
index c8fe367..6c69d85 100644
--- a/data/resources/editor-toolbar.ui
+++ b/data/resources/editor-toolbar.ui
@@ -30,18 +30,6 @@
<property name="icon_name">format-text-strikethrough-symbolic</property>
<property name="icon_size">1</property>
</object>
- <object class="GtkImage" id="format-indent-more">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="icon_name">format-indent-more-symbolic</property>
- <property name="icon_size">1</property>
- </object>
- <object class="GtkImage" id="format-indent-less">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="icon_name">format-indent-less-symbolic</property>
- <property name="icon_size">1</property>
- </object>
<template class="BjbEditorToolbar" parent="GtkActionBar">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -154,50 +142,6 @@
<property name="position">1</property>
</packing>
</child>
- <child>
- <object class="GtkButtonBox">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="layout_style">expand</property>
- <child>
- <object class="GtkButton" id="indent_button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="tooltip_text" translatable="yes">Indent</property>
- <property name="image">format-indent-more</property>
- <property name="use_underline">True</property>
- <signal name="clicked" handler="on_indent_clicked" object="BjbEditorToolbar" swapped="no"/>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="outdent_button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="tooltip_text" translatable="yes">Outdent</property>
- <property name="image">format-indent-less</property>
- <property name="use_underline">True</property>
- <signal name="clicked" handler="on_outdent_clicked" object="BjbEditorToolbar" swapped="no"/>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
</object>
<packing>
<property name="position">0</property>
diff --git a/src/bjb-editor-toolbar.c b/src/bjb-editor-toolbar.c
index a95b801..945b3e6 100644
--- a/src/bjb-editor-toolbar.c
+++ b/src/bjb-editor-toolbar.c
@@ -52,9 +52,6 @@ struct _BjbEditorToolbar
GtkWidget *bullets_button;
GtkWidget *list_button;
-
- GtkWidget *indent_button;
- GtkWidget *outdent_button;
};
G_DEFINE_TYPE (BjbEditorToolbar, bjb_editor_toolbar, GTK_TYPE_ACTION_BAR)
@@ -94,20 +91,6 @@ on_list_clicked (GtkButton *button,
biji_note_obj_editor_apply_format (self->note, BIJI_ORDER_LIST);
}
-static void
-on_indent_clicked (GtkButton *button,
- BjbEditorToolbar *self)
-{
- biji_note_obj_editor_apply_format (self->note, BIJI_INDENT);
-}
-
-static void
-on_outdent_clicked (GtkButton *button,
- BjbEditorToolbar *self)
-{
- biji_note_obj_editor_apply_format (self->note, BIJI_OUTDENT);
-}
-
static void
on_link_clicked (GtkButton *button,
BjbEditorToolbar *self)
@@ -206,9 +189,6 @@ bjb_editor_toolbar_constructed (GObject *object)
gtk_widget_set_sensitive (self->bullets_button, can_format);
gtk_widget_set_sensitive (self->list_button, can_format);
-
- gtk_widget_set_sensitive (self->indent_button, can_format);
- gtk_widget_set_sensitive (self->outdent_button, can_format);
}
static void
@@ -264,16 +244,12 @@ bjb_editor_toolbar_class_init (BjbEditorToolbarClass *klass)
gtk_widget_class_bind_template_child (widget_class, BjbEditorToolbar, strike_button);
gtk_widget_class_bind_template_child (widget_class, BjbEditorToolbar, bullets_button);
gtk_widget_class_bind_template_child (widget_class, BjbEditorToolbar, list_button);
- gtk_widget_class_bind_template_child (widget_class, BjbEditorToolbar, indent_button);
- gtk_widget_class_bind_template_child (widget_class, BjbEditorToolbar, outdent_button);
gtk_widget_class_bind_template_callback (widget_class, on_bold_clicked);
gtk_widget_class_bind_template_callback (widget_class, on_italic_clicked);
gtk_widget_class_bind_template_callback (widget_class, on_strike_clicked);
gtk_widget_class_bind_template_callback (widget_class, on_bullets_clicked);
gtk_widget_class_bind_template_callback (widget_class, on_list_clicked);
- gtk_widget_class_bind_template_callback (widget_class, on_indent_clicked);
- gtk_widget_class_bind_template_callback (widget_class, on_outdent_clicked);
gtk_widget_class_bind_template_callback (widget_class, on_link_clicked);
}
diff --git a/src/libbiji/biji-note-obj.h b/src/libbiji/biji-note-obj.h
index 2ec07a2..20187c3 100644
--- a/src/libbiji/biji-note-obj.h
+++ b/src/libbiji/biji-note-obj.h
@@ -36,9 +36,7 @@ typedef enum
BIJI_ITALIC,
BIJI_STRIKE,
BIJI_BULLET_LIST,
- BIJI_ORDER_LIST,
- BIJI_INDENT,
- BIJI_OUTDENT
+ BIJI_ORDER_LIST
} BijiEditorFormat;
#define BIJI_TYPE_NOTE_OBJ (biji_note_obj_get_type ())
diff --git a/src/libbiji/editor/biji-webkit-editor.c b/src/libbiji/editor/biji-webkit-editor.c
index 3013bb0..1223d79 100644
--- a/src/libbiji/editor/biji-webkit-editor.c
+++ b/src/libbiji/editor/biji-webkit-editor.c
@@ -47,9 +47,7 @@ enum {
typedef enum {
BLOCK_FORMAT_NONE,
BLOCK_FORMAT_UNORDERED_LIST,
- BLOCK_FORMAT_ORDERED_LIST,
- BLOCK_FORMAT_INDENT,
- BLOCK_FORMAT_OUTDENT
+ BLOCK_FORMAT_ORDERED_LIST
} BlockFormat;
static guint biji_editor_signals [EDITOR_SIGNALS] = { 0 };
@@ -145,12 +143,6 @@ biji_toggle_block_format (BijiWebkitEditor *self,
case BLOCK_FORMAT_ORDERED_LIST:
webkit_web_view_execute_editing_command (WEBKIT_WEB_VIEW (self), "insertOrderedList");
break;
- case BLOCK_FORMAT_INDENT:
- webkit_web_view_execute_editing_command (WEBKIT_WEB_VIEW (self), "indent");
- break;
- case BLOCK_FORMAT_OUTDENT:
- webkit_web_view_execute_editing_command (WEBKIT_WEB_VIEW (self), "outdent");
- break;
default:
g_assert_not_reached ();
}
@@ -160,8 +152,6 @@ void
biji_webkit_editor_apply_format (BijiWebkitEditor *self, gint format)
{
BijiWebkitEditorPrivate *priv = self->priv;
- gboolean has_list = priv->block_format == BLOCK_FORMAT_UNORDERED_LIST
- || priv-> block_format == BLOCK_FORMAT_ORDERED_LIST;
if (priv->has_text)
{
@@ -190,16 +180,6 @@ biji_webkit_editor_apply_format (BijiWebkitEditor *self, gint format)
biji_toggle_block_format (self, BLOCK_FORMAT_ORDERED_LIST);
break;
- case BIJI_INDENT:
- if (has_list)
- biji_toggle_block_format (self, BLOCK_FORMAT_INDENT);
- break;
-
- case BIJI_OUTDENT:
- if (has_list)
- biji_toggle_block_format (self, BLOCK_FORMAT_OUTDENT);
- break;
-
default:
g_warning ("biji_webkit_editor_apply_format : Invalid format");
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]