[evolution/wip/webkit-composer: 550/966] Make 'Text Properties' dialog work



commit 596eb45fc2b792551851e270a01effa7a5cb2150
Author: Dan Vrátil <dvratil redhat com>
Date:   Tue Aug 14 13:24:53 2012 +0200

    Make 'Text Properties' dialog work
    
    Implement Text Properties dialog as EEditorTextDialog class.

 e-util/Makefile.am            |    2 +
 e-util/e-editor-actions.c     |    7 +-
 e-util/e-editor-builder.ui    |  256 -----------------------------------------
 e-util/e-editor-private.h     |    2 +
 e-util/e-editor-text-dialog.c |  115 ++++++++++++++++++
 e-util/e-editor-text-dialog.h |   13 ++
 e-util/e-util.h               |    1 +
 7 files changed, 139 insertions(+), 257 deletions(-)
---
diff --git a/e-util/Makefile.am b/e-util/Makefile.am
index 4ca20cf..2d57449 100644
--- a/e-util/Makefile.am
+++ b/e-util/Makefile.am
@@ -189,6 +189,7 @@ evolution_util_include_HEADERS =  \
        e-editor-replace-dialog.h \
        e-editor-selection.h \
        e-editor-table-dialog.h \
+       e-editor-text-dialog.h \
        e-editor-utils.h \
        e-editor-widget.h \
        e-editor-widgets.h \
@@ -458,6 +459,7 @@ libevolution_util_la_SOURCES = \
        e-editor-replace-dialog.c \
        e-editor-selection.c \
        e-editor-table-dialog.c \
+       e-editor-text-dialog.c \
        e-editor-utils.c \
        e-editor-widget.c \
        e-editor.c \
diff --git a/e-util/e-editor-actions.c b/e-util/e-editor-actions.c
index f61be4a..05bfef0 100644
--- a/e-util/e-editor-actions.c
+++ b/e-util/e-editor-actions.c
@@ -975,7 +975,12 @@ static void
 action_properties_text_cb (GtkAction *action,
                            EEditor *editor)
 {
-       gtk_window_present (GTK_WINDOW (WIDGET (TEXT_PROPERTIES_WINDOW)));
+       if (editor->priv->text_dialog == NULL) {
+               editor->priv->text_dialog =
+                       e_editor_text_dialog_new (editor);
+       }
+
+       gtk_window_present (GTK_WINDOW (editor->priv->text_dialog));
 }
 
 static void
diff --git a/e-util/e-editor-builder.ui b/e-util/e-editor-builder.ui
index 50e220f..1e4aa1e 100644
--- a/e-util/e-editor-builder.ui
+++ b/e-util/e-editor-builder.ui
@@ -285,262 +285,6 @@
       </row>
     </data>
   </object>
-  <object class="GtkWindow" id="text-properties-window">
-    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | 
GDK_BUTTON_RELEASE_MASK</property>
-    <property name="title" translatable="yes">Text Properties</property>
-    <property name="resizable">False</property>
-    <property name="modal">True</property>
-    <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
-    <property name="destroy_with_parent">True</property>
-    <signal handler="gtk_widget_hide_on_delete" name="delete_event"/>
-    <child>
-      <object class="GtkVBox" id="text-properties-vbox">
-        <property name="visible">True</property>
-        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-        <property name="border_width">12</property>
-        <property name="spacing">12</property>
-        <child>
-          <object class="GtkHBox" id="text-properties-inner-hbox">
-            <property name="visible">True</property>
-            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-            <property name="border_width">6</property>
-            <property name="spacing">12</property>
-            <child>
-              <object class="GtkTable" id="text-properties-table-left">
-                <property name="visible">True</property>
-                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                <property name="n_rows">4</property>
-                <property name="n_columns">2</property>
-                <property name="column_spacing">6</property>
-                <property name="row_spacing">6</property>
-                <child>
-                  <object class="GtkCheckButton" id="text-properties-strikethrough-button">
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                    <property name="label" translatable="yes">_Strikethrough</property>
-                    <property name="use_underline">True</property>
-                    <property name="draw_indicator">True</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">1</property>
-                    <property name="right_attach">2</property>
-                    <property name="top_attach">3</property>
-                    <property name="bottom_attach">4</property>
-                    <property name="y_options"/>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkCheckButton" id="text-properties-underline-button">
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                    <property name="label" translatable="yes">_Underline</property>
-                    <property name="use_underline">True</property>
-                    <property name="draw_indicator">True</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">1</property>
-                    <property name="right_attach">2</property>
-                    <property name="top_attach">2</property>
-                    <property name="bottom_attach">3</property>
-                    <property name="y_options"/>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkCheckButton" id="text-properties-italic-button">
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                    <property name="label" translatable="yes">_Italic</property>
-                    <property name="use_underline">True</property>
-                    <property name="draw_indicator">True</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">1</property>
-                    <property name="right_attach">2</property>
-                    <property name="top_attach">1</property>
-                    <property name="bottom_attach">2</property>
-                    <property name="y_options"/>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkCheckButton" id="text-properties-bold-button">
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                    <property name="label" translatable="yes">_Bold</property>
-                    <property name="use_underline">True</property>
-                    <property name="draw_indicator">True</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">1</property>
-                    <property name="right_attach">2</property>
-                    <property name="y_options"/>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkImage" id="text-properties-strikethrough-image">
-                    <property name="visible">True</property>
-                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                    <property name="stock">gtk-strikethrough</property>
-                  </object>
-                  <packing>
-                    <property name="top_attach">3</property>
-                    <property name="bottom_attach">4</property>
-                    <property name="x_options"/>
-                    <property name="y_options"/>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkImage" id="text-properties-underline-image">
-                    <property name="visible">True</property>
-                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                    <property name="stock">gtk-underline</property>
-                  </object>
-                  <packing>
-                    <property name="top_attach">2</property>
-                    <property name="bottom_attach">3</property>
-                    <property name="x_options"/>
-                    <property name="y_options"/>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkImage" id="text-properties-italic-image">
-                    <property name="visible">True</property>
-                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                    <property name="stock">gtk-italic</property>
-                  </object>
-                  <packing>
-                    <property name="top_attach">1</property>
-                    <property name="bottom_attach">2</property>
-                    <property name="x_options"/>
-                    <property name="y_options"/>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkImage" id="text-properties-bold-image">
-                    <property name="visible">True</property>
-                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                    <property name="stock">gtk-bold</property>
-                  </object>
-                  <packing>
-                    <property name="x_options"/>
-                    <property name="y_options"/>
-                  </packing>
-                </child>
-              </object>
-            </child>
-            <child>
-              <object class="GtkTable" id="text-properties-table-right">
-                <property name="visible">True</property>
-                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                <property name="n_rows">3</property>
-                <property name="n_columns">2</property>
-                <property name="column_spacing">6</property>
-                <property name="row_spacing">6</property>
-                <child>
-                  <object class="EColorCombo" id="text-properties-color-combo" 
type-func="e_color_combo_get_type">
-                    <property name="visible">True</property>
-                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                    <property name="default_label">Automatic</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">1</property>
-                    <property name="right_attach">2</property>
-                    <property name="y_options">GTK_FILL</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkLabel" id="text-properties-size-label">
-                    <property name="visible">True</property>
-                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                    <property name="label" translatable="yes">Si_ze:</property>
-                    <property name="use_underline">True</property>
-                  </object>
-                  <packing>
-                    <property name="top_attach">1</property>
-                    <property name="bottom_attach">2</property>
-                    <property name="x_options">GTK_FILL</property>
-                    <property name="y_options"/>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkLabel" id="text-properties-color-label">
-                    <property name="visible">True</property>
-                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                    <property name="label" translatable="yes">_Color:</property>
-                    <property name="use_underline">True</property>
-                  </object>
-                  <packing>
-                    <property name="x_options">GTK_FILL</property>
-                    <property name="y_options"/>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkAlignment" id="text-properties-alignment">
-                    <property name="visible">True</property>
-                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                    <child>
-                      <placeholder/>
-                    </child>
-                  </object>
-                  <packing>
-                    <property name="right_attach">2</property>
-                    <property name="top_attach">2</property>
-                    <property name="bottom_attach">3</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="EActionComboBox" id="text-properties-size-combo-box" 
type-func="e_action_combo_box_get_type">
-                    <property name="visible">True</property>
-                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">1</property>
-                    <property name="right_attach">2</property>
-                    <property name="top_attach">1</property>
-                    <property name="bottom_attach">2</property>
-                    <property name="y_options"/>
-                  </packing>
-                </child>
-              </object>
-              <packing>
-                <property name="position">1</property>
-              </packing>
-            </child>
-          </object>
-        </child>
-        <child>
-          <object class="GtkHButtonBox" id="text-properties-button-box">
-            <property name="visible">True</property>
-            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-            <property name="layout_style">GTK_BUTTONBOX_END</property>
-            <child>
-              <object class="GtkButton" id="text-properties-ok-button">
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                <property name="label">gtk-ok</property>
-                <property name="use_stock">True</property>
-                <signal handler="gtk_widget_hide" name="clicked" object="text-properties-window"/>
-              </object>
-              <packing>
-                <property name="position">1</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">False</property>
-            <property name="pack_type">GTK_PACK_END</property>
-            <property name="position">1</property>
-          </packing>
-        </child>
-      </object>
-    </child>
-  </object>
   <object class="GtkWindow" id="paragraph-properties-window">
     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | 
GDK_BUTTON_RELEASE_MASK</property>
     <property name="title" translatable="yes">Paragraph Properties</property>
diff --git a/e-util/e-editor-private.h b/e-util/e-editor-private.h
index 77bb54e..d5dae99 100644
--- a/e-util/e-editor-private.h
+++ b/e-util/e-editor-private.h
@@ -31,6 +31,7 @@
 #include <e-editor-table-dialog.h>
 #include <e-editor-page-dialog.h>
 #include <e-editor-image-dialog.h>
+#include <e-editor-text-dialog.h>
 
 #ifdef HAVE_XFREE
 #include <X11/XF86keysym.h>
@@ -66,6 +67,7 @@ struct _EEditorPrivate {
        GtkWidget *table_dialog;
        GtkWidget *page_dialog;
        GtkWidget *image_dialog;
+       GtkWidget *text_dialog;
 
        GtkWidget *color_combo_box;
        GtkWidget *mode_combo_box;
diff --git a/e-util/e-editor-text-dialog.c b/e-util/e-editor-text-dialog.c
index 78cc052..09f012a 100644
--- a/e-util/e-editor-text-dialog.c
+++ b/e-util/e-editor-text-dialog.c
@@ -1,8 +1,11 @@
 /*
  * e-editor-text-dialog.c
  *
+<<<<<<< HEAD
  * Copyright (C) 2012 Dan Vrátil <dvratil redhat com>
  *
+=======
+>>>>>>> Make 'Text Properties' dialog work
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
@@ -28,9 +31,16 @@
 
 #include "e-color-combo.h"
 
+<<<<<<< HEAD
 #define E_EDITOR_TEXT_DIALOG_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
        ((obj), E_TYPE_EDITOR_TEXT_DIALOG, EEditorTextDialogPrivate))
+=======
+G_DEFINE_TYPE (
+       EEditorTextDialog,
+       e_editor_text_dialog,
+       E_TYPE_EDITOR_DIALOG);
+>>>>>>> Make 'Text Properties' dialog work
 
 struct _EEditorTextDialogPrivate {
        GtkWidget *bold_check;
@@ -40,12 +50,19 @@ struct _EEditorTextDialogPrivate {
 
        GtkWidget *color_check;
        GtkWidget *size_check;
+<<<<<<< HEAD
 };
 
 G_DEFINE_TYPE (
        EEditorTextDialog,
        e_editor_text_dialog,
        E_TYPE_EDITOR_DIALOG);
+=======
+
+       GtkWidget *close_button;
+};
+
+>>>>>>> Make 'Text Properties' dialog work
 
 static void
 editor_text_dialog_set_bold (EEditorTextDialog *dialog)
@@ -149,6 +166,7 @@ editor_text_dialog_set_size (EEditorTextDialog *dialog)
 }
 
 static void
+<<<<<<< HEAD
 editor_text_dialog_show (GtkWidget *widget)
 {
        EEditorTextDialog *dialog;
@@ -174,6 +192,33 @@ editor_text_dialog_show (GtkWidget *widget)
        gtk_toggle_button_set_active (
                GTK_TOGGLE_BUTTON (dialog->priv->strikethrough_check),
                e_editor_selection_is_strike_through (selection));
+=======
+editor_text_dialog_show (GtkWidget *gtk_widget)
+{
+       EEditorTextDialog *dialog;
+       EEditor *editor;
+       EEditorWidget *widget;
+       EEditorSelection *selection;
+       GdkRGBA rgba;
+
+       dialog = E_EDITOR_TEXT_DIALOG (gtk_widget);
+       editor = e_editor_dialog_get_editor (E_EDITOR_DIALOG (dialog));
+       widget = e_editor_get_editor_widget (editor);
+       selection = e_editor_widget_get_selection (widget);
+
+       gtk_toggle_button_set_active (
+               GTK_TOGGLE_BUTTON (dialog->priv->bold_check),
+               e_editor_selection_get_bold (selection));
+       gtk_toggle_button_set_active (
+               GTK_TOGGLE_BUTTON (dialog->priv->italic_check),
+               e_editor_selection_get_italic (selection));
+       gtk_toggle_button_set_active (
+               GTK_TOGGLE_BUTTON (dialog->priv->underline_check),
+               e_editor_selection_get_underline (selection));
+       gtk_toggle_button_set_active (
+               GTK_TOGGLE_BUTTON (dialog->priv->strikethrough_check),
+               e_editor_selection_get_strike_through (selection));
+>>>>>>> Make 'Text Properties' dialog work
 
        gtk_combo_box_set_active (
                GTK_COMBO_BOX (dialog->priv->size_check),
@@ -183,6 +228,7 @@ editor_text_dialog_show (GtkWidget *widget)
        e_color_combo_set_current_color (
                E_COLOR_COMBO (dialog->priv->color_check), &rgba);
 
+<<<<<<< HEAD
        GTK_WIDGET_CLASS (e_editor_text_dialog_parent_class)->show (widget);
 }
 
@@ -194,6 +240,20 @@ e_editor_text_dialog_class_init (EEditorTextDialogClass *class)
        g_type_class_add_private (class, sizeof (EEditorTextDialogPrivate));
 
        widget_class = GTK_WIDGET_CLASS (class);
+=======
+       GTK_WIDGET_CLASS (e_editor_text_dialog_parent_class)->show (gtk_widget);
+}
+
+static void
+e_editor_text_dialog_class_init (EEditorTextDialogClass *klass)
+{
+       GtkWidgetClass *widget_class;
+
+       e_editor_text_dialog_parent_class = g_type_class_peek_parent (klass);
+       g_type_class_add_private (klass, sizeof (EEditorTextDialogPrivate));
+
+       widget_class = GTK_WIDGET_CLASS (klass);
+>>>>>>> Make 'Text Properties' dialog work
        widget_class->show = editor_text_dialog_show;
 }
 
@@ -203,15 +263,30 @@ e_editor_text_dialog_init (EEditorTextDialog *dialog)
        GtkGrid *main_layout;
        GtkWidget *widget;
 
+<<<<<<< HEAD
        dialog->priv = E_EDITOR_TEXT_DIALOG_GET_PRIVATE (dialog);
 
        main_layout = e_editor_dialog_get_container (E_EDITOR_DIALOG (dialog));
+=======
+       dialog->priv = G_TYPE_INSTANCE_GET_PRIVATE (
+               dialog, E_TYPE_EDITOR_TEXT_DIALOG, EEditorTextDialogPrivate);
+
+       main_layout = GTK_GRID (gtk_grid_new ());
+       gtk_grid_set_row_spacing (main_layout, 5);
+       gtk_grid_set_column_spacing (main_layout, 5);
+       gtk_container_add (GTK_CONTAINER (dialog), GTK_WIDGET (main_layout));
+       gtk_container_set_border_width (GTK_CONTAINER (dialog), 10);
+>>>>>>> Make 'Text Properties' dialog work
 
        /* Bold */
        widget = gtk_image_new_from_stock (GTK_STOCK_BOLD, GTK_ICON_SIZE_BUTTON);
        gtk_grid_attach (main_layout, widget, 0, 0, 1, 1);
 
+<<<<<<< HEAD
        widget = gtk_check_button_new_with_mnemonic (_("_Bold"));
+=======
+       widget = gtk_check_button_new_with_mnemonic (_("Bold"));
+>>>>>>> Make 'Text Properties' dialog work
        gtk_grid_attach (main_layout, widget, 1, 0, 1, 1);
        g_signal_connect_swapped (
                widget, "toggled",
@@ -222,7 +297,11 @@ e_editor_text_dialog_init (EEditorTextDialog *dialog)
        widget = gtk_image_new_from_stock (GTK_STOCK_ITALIC, GTK_ICON_SIZE_BUTTON);
        gtk_grid_attach (main_layout, widget, 0, 1, 1, 1);
 
+<<<<<<< HEAD
        widget = gtk_check_button_new_with_mnemonic (_("_Italic"));
+=======
+       widget = gtk_check_button_new_with_mnemonic (_("Italic"));
+>>>>>>> Make 'Text Properties' dialog work
        gtk_grid_attach (main_layout, widget, 1, 1, 1, 1);
        g_signal_connect_swapped (
                widget, "toggled",
@@ -233,7 +312,11 @@ e_editor_text_dialog_init (EEditorTextDialog *dialog)
        widget = gtk_image_new_from_stock (GTK_STOCK_UNDERLINE, GTK_ICON_SIZE_BUTTON);
        gtk_grid_attach (main_layout, widget, 0, 2, 1, 1);
 
+<<<<<<< HEAD
        widget = gtk_check_button_new_with_mnemonic (_("_Underline"));
+=======
+       widget = gtk_check_button_new_with_mnemonic (_("Underline"));
+>>>>>>> Make 'Text Properties' dialog work
        gtk_grid_attach (main_layout, widget, 1, 2, 1, 1);
        g_signal_connect_swapped (
                widget, "toggled",
@@ -243,7 +326,11 @@ e_editor_text_dialog_init (EEditorTextDialog *dialog)
        widget = gtk_image_new_from_stock (GTK_STOCK_STRIKETHROUGH, GTK_ICON_SIZE_BUTTON);
        gtk_grid_attach (main_layout, widget, 0, 3, 1, 1);
 
+<<<<<<< HEAD
        widget = gtk_check_button_new_with_mnemonic (_("_Strikethrough"));
+=======
+       widget = gtk_check_button_new_with_mnemonic (_("Strikethrough"));
+>>>>>>> Make 'Text Properties' dialog work
        gtk_grid_attach (main_layout, widget, 1, 3, 1, 1);
        g_signal_connect_swapped (
                widget, "toggled",
@@ -258,8 +345,12 @@ e_editor_text_dialog_init (EEditorTextDialog *dialog)
                G_CALLBACK (editor_text_dialog_set_color), dialog);
        dialog->priv->color_check = widget;
 
+<<<<<<< HEAD
        widget = gtk_label_new_with_mnemonic (_("_Color:"));
        gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);
+=======
+       widget = gtk_label_new_with_mnemonic (_("Color:"));
+>>>>>>> Make 'Text Properties' dialog work
        gtk_label_set_mnemonic_widget (GTK_LABEL (widget), dialog->priv->color_check);
        gtk_grid_attach (main_layout, widget, 2, 0, 1, 1);
 
@@ -278,6 +369,7 @@ e_editor_text_dialog_init (EEditorTextDialog *dialog)
                G_CALLBACK (editor_text_dialog_set_size), dialog);
        dialog->priv->size_check = widget;
 
+<<<<<<< HEAD
        widget = gtk_label_new_with_mnemonic (_("Si_ze:"));
        gtk_label_set_justify (GTK_LABEL (widget), GTK_JUSTIFY_RIGHT);
        gtk_label_set_mnemonic_widget (GTK_LABEL (widget), dialog->priv->size_check);
@@ -286,6 +378,29 @@ e_editor_text_dialog_init (EEditorTextDialog *dialog)
        gtk_widget_show_all (GTK_WIDGET (main_layout));
 }
 
+=======
+       widget = gtk_label_new_with_mnemonic (_("Size:"));
+       gtk_label_set_mnemonic_widget (GTK_LABEL (widget), dialog->priv->size_check);
+       gtk_grid_attach (main_layout, widget, 2, 1, 1, 1);
+
+       /* Close button */
+       widget = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
+       g_signal_connect_swapped (
+               widget, "clicked",
+               G_CALLBACK (gtk_widget_hide), dialog);
+       dialog->priv->close_button = widget;
+
+       widget = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
+       gtk_button_box_set_layout (GTK_BUTTON_BOX (widget), GTK_BUTTONBOX_END);
+       gtk_container_set_border_width (GTK_CONTAINER (widget), 5);
+       gtk_grid_attach (main_layout, widget, 0, 4, 4, 1);
+       gtk_box_pack_start (GTK_BOX (widget), dialog->priv->close_button, FALSE, FALSE, 5);
+
+       gtk_widget_show_all (GTK_WIDGET (main_layout));
+}
+
+
+>>>>>>> Make 'Text Properties' dialog work
 GtkWidget *
 e_editor_text_dialog_new (EEditor *editor)
 {
diff --git a/e-util/e-editor-text-dialog.h b/e-util/e-editor-text-dialog.h
index 2acaf30..3526894 100644
--- a/e-util/e-editor-text-dialog.h
+++ b/e-util/e-editor-text-dialog.h
@@ -1,8 +1,11 @@
 /*
  * e-editor-text-dialog.h
  *
+<<<<<<< HEAD
  * Copyright (C) 2012 Dan Vrátil <dvratil redhat com>
  *
+=======
+>>>>>>> Make 'Text Properties' dialog work
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
@@ -54,6 +57,10 @@ typedef struct _EEditorTextDialogPrivate EEditorTextDialogPrivate;
 
 struct _EEditorTextDialog {
        EEditorDialog parent;
+<<<<<<< HEAD
+=======
+
+>>>>>>> Make 'Text Properties' dialog work
        EEditorTextDialogPrivate *priv;
 };
 
@@ -61,8 +68,14 @@ struct _EEditorTextDialogClass {
        EEditorDialogClass parent_class;
 };
 
+<<<<<<< HEAD
 GType          e_editor_text_dialog_get_type   (void) G_GNUC_CONST;
 GtkWidget *    e_editor_text_dialog_new        (EEditor *editor);
+=======
+GType          e_editor_text_dialog_get_type   (void);
+
+GtkWidget*     e_editor_text_dialog_new        (EEditor *editor);
+>>>>>>> Make 'Text Properties' dialog work
 
 G_END_DECLS
 
diff --git a/e-util/e-util.h b/e-util/e-util.h
index 5ce54ca..b985ef4 100644
--- a/e-util/e-util.h
+++ b/e-util/e-util.h
@@ -101,6 +101,7 @@
 #include <e-util/e-editor-replace-dialog.h>
 #include <e-util/e-editor-selection.h>
 #include <e-util/e-editor-table-dialog.h>
+#include <e-util/e-editor-text-dialog.h>
 #include <e-util/e-editor-utils.h>
 #include <e-util/e-editor-widget.h>
 #include <e-util/e-editor-widgets.h>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]