Commit 63f39eed authored by Isaque Galdino de Araujo's avatar Isaque Galdino de Araujo

editor-toolbar: Make it always visible

parent 4493f23c
......@@ -27,9 +27,6 @@
<template class="BjbEditorToolbar" parent="GtkActionBar">
<property name="visible">True</property>
<property name="can_focus">False</property>
<style>
<class name="osd" />
</style>
<child>
<object class="GtkButtonBox">
<property name="visible">True</property>
......
......@@ -56,24 +56,11 @@ struct _BjbEditorToolbar
G_DEFINE_TYPE (BjbEditorToolbar, bjb_editor_toolbar, GTK_TYPE_ACTION_BAR)
static gboolean
on_release_event (GtkWidget *widget,
GdkEvent *event,
BjbEditorToolbar *self)
{
gtk_widget_set_visible (GTK_WIDGET (self),
biji_note_obj_editor_has_selection (self->note));
return FALSE;
}
static void
on_cut_clicked (GtkButton *button,
BjbEditorToolbar *self)
{
biji_note_obj_editor_cut (self->note);
gtk_widget_hide (GTK_WIDGET (self));
}
static void
......@@ -88,8 +75,6 @@ on_paste_clicked (GtkButton *button,
BjbEditorToolbar *self)
{
biji_note_obj_editor_paste (self->note);
gtk_widget_hide (GTK_WIDGET (self));
}
static void
......@@ -140,7 +125,7 @@ on_link_clicked (GtkButton *button,
link = biji_note_obj_editor_get_selection (self->note);
if (link == NULL)
if (link == NULL || strlen (link) == 0)
return;
window = bjb_note_view_get_base_window (self->view);
......@@ -198,7 +183,6 @@ static void
bjb_editor_toolbar_constructed (GObject *object)
{
BjbEditorToolbar *self;
GtkWidget *view;
GtkWidget *window;
gboolean can_format;
......@@ -218,14 +202,6 @@ bjb_editor_toolbar_constructed (GObject *object)
gtk_widget_add_accelerator (self->strike_button, "clicked", self->accel,
GDK_KEY_s, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
view = biji_note_obj_get_editor (self->note);
g_signal_connect (view,"button-release-event",
G_CALLBACK (on_release_event), self);
g_signal_connect (view,"key-release-event",
G_CALLBACK (on_release_event), self);
can_format = biji_note_obj_can_format (self->note);
gtk_widget_set_sensitive (self->bold_button, can_format);
......
......@@ -233,7 +233,6 @@ bjb_note_view_constructed (GObject *obj)
/* Edition Toolbar for text selection */
self->edit_bar = bjb_editor_toolbar_new (self, self->note);
gtk_box_pack_start (GTK_BOX (self->box), self->edit_bar, FALSE, TRUE, 0);
gtk_widget_hide (self->edit_bar);
}
BjbNoteView *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment