r3395 - in trunk/src/target/OM-2007.2/applications/openmoko-dialer2: . src/common
thomas at sita.openmoko.org
thomas at sita.openmoko.org
Mon Nov 12 11:58:23 CET 2007
Author: thomas
Date: 2007-11-12 11:58:20 +0100 (Mon, 12 Nov 2007)
New Revision: 3395
Modified:
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/common/moko-dialer-textview.c
trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/common/moko-dialer-textview.h
Log:
* src/common/moko-dialer-textview.c: (moko_dialer_textview_init),
(moko_dialer_textview_set_color):
* src/common/moko-dialer-textview.h:
Remove cursor indicator and always add/remove characters from the end of
the dialer display. Closes bug 940.
Modified: trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog 2007-11-12 09:42:38 UTC (rev 3394)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog 2007-11-12 10:58:20 UTC (rev 3395)
@@ -1,11 +1,19 @@
2007-11-12 Thomas Wood <thomas at openedhand.com>
+ * src/common/moko-dialer-textview.c: (moko_dialer_textview_init),
+ (moko_dialer_textview_set_color):
+ * src/common/moko-dialer-textview.h:
+
+ Remove cursor indicator and always add/remove characters from the end of
+ the dialer display. Closes bug 940.
+
+2007-11-12 Thomas Wood <thomas at openedhand.com>
+
Patch by: Milko Krachounov <exabyte at 3mhz.net>
* src/common/moko-dialer-panel.c: (moko_dialer_panel_hold_timeout),
(moko_dialer_panel_pressed): Automatically free the allocated data
- structure when the timeout source is
- destroyed
+ structure when the timeout source is destroyed. Closes bug 1004.
2007-11-05 Thomas Wood <thomas at openedhand.com>
Modified: trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/common/moko-dialer-textview.c
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/common/moko-dialer-textview.c 2007-11-12 09:42:38 UTC (rev 3394)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/common/moko-dialer-textview.c 2007-11-12 10:58:20 UTC (rev 3395)
@@ -99,8 +99,8 @@
buffer = gtk_text_view_get_buffer (textview);
moko_dialer_textview->font_desc_textview = NULL;
moko_dialer_textview->tag_for_inputed = NULL;
- moko_dialer_textview->tag_for_cursor = NULL;
- moko_dialer_textview->tag_for_autofilled = NULL;
+// moko_dialer_textview->tag_for_cursor = NULL;
+// moko_dialer_textview->tag_for_autofilled = NULL;
GTK_WIDGET_UNSET_FLAGS (textview, GTK_CAN_FOCUS);
gtk_text_view_set_editable (GTK_TEXT_VIEW (textview), FALSE);
@@ -127,9 +127,7 @@
/* save it to the structure for later usage. */
moko_dialer_textview->font_desc_textview = font_desc_textview;
}
- moko_dialer_textview->tag_for_cursor =
- gtk_text_buffer_create_tag (buffer, "tag_cursor", "weight",
- "PANGO_WEIGHT_BOLD", NULL);
+
moko_dialer_textview->sensed = FALSE;
@@ -163,7 +161,7 @@
{
GtkTextBuffer *buffer;
- GtkTextIter start, cursoriter_1, cursoriter;
+ GtkTextIter start, cursoriter;
GtkTextIter end;
gint small = 10, medium = 10, large = 10;
@@ -191,30 +189,6 @@
if (text && (strlen (text) < 1))
return;
- gint cur = gtk_text_iter_get_offset (&cursoriter);
-
- if (cur > 0)
- {
- gtk_text_buffer_remove_all_tags (buffer, &start, &end);
-
- gtk_text_buffer_get_iter_at_offset (buffer, &cursoriter_1, cur - 1);
-// gtk_text_buffer_apply_tag (buffer,
-// moko_dialer_textview->tag_for_inputed,
-// &start, &cursoriter);
-// gtk_text_buffer_apply_tag (buffer,
-// moko_dialer_textview->tag_for_autofilled,
-// &cursoriter, &end);
- gtk_text_buffer_apply_tag (buffer, moko_dialer_textview->tag_for_cursor,
- &cursoriter_1, &cursoriter);
-
- }
- else
- { // cur==0
-// gtk_text_buffer_apply_tag (buffer,
-// moko_dialer_textview->tag_for_autofilled,
-// &cursoriter, &end);
- }
-
/* get font sizes */
gtk_widget_style_get (GTK_WIDGET (moko_dialer_textview), "small_font", &small, NULL);
gtk_widget_style_get (GTK_WIDGET (moko_dialer_textview), "medium_font", &medium, NULL);
@@ -321,8 +295,7 @@
len = gtk_text_buffer_get_char_count (buffer);
- gtk_text_buffer_insert_at_cursor (buffer, number,
- g_utf8_strlen (number, -1));
+ gtk_text_buffer_insert (buffer, &end, number, -1);
len = len + g_utf8_strlen (number, -1);
/* reget the cursor iter. */
@@ -413,8 +386,11 @@
}
else
{
- // no selection, then just perform backspace.
- gtk_text_buffer_backspace (buffer, &insertiter, TRUE, TRUE);
+ /* no selection, then just perform backspace. */
+ GtkTextIter enditer;
+
+ gtk_text_buffer_get_end_iter (buffer, &enditer);
+ gtk_text_buffer_backspace (buffer, &enditer, TRUE, TRUE);
}
//now we get the inputed string length.
Modified: trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/common/moko-dialer-textview.h
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/common/moko-dialer-textview.h 2007-11-12 09:42:38 UTC (rev 3394)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/common/moko-dialer-textview.h 2007-11-12 10:58:20 UTC (rev 3395)
@@ -45,8 +45,8 @@
GtkTextView textview; /* the main widget */
PangoFontDescription *font_desc_textview; /* the font description of this textview */
GtkTextTag *tag_for_inputed; /* the formating tag for the digits user already inputed */
- GtkTextTag *tag_for_cursor; /* the formatting tag for the right digit user just inputed. */
- GtkTextTag *tag_for_autofilled; /* the formatting tag for the autofilled digits if any. */
+ // GtkTextTag *tag_for_cursor; /* the formatting tag for the right digit user just inputed. */
+ // GtkTextTag *tag_for_autofilled; /* the formatting tag for the autofilled digits if any. */
gboolean sensed;
};
More information about the commitlog
mailing list