Author: rpmcruz
Date: Wed Dec 10 01:14:59 2008
New Revision: 54011
URL: http://svn.opensuse.org/viewcvs/yast?rev=54011&view=rev
Log:
* src/ygtktextview.c: polishes read-only GtkTextView a little bit.
* src/YGText.cc & src/ygtkrichtext.c: use YGtkTextView.
Modified:
trunk/gtk/ChangeLog
trunk/gtk/src/Makefile.am
trunk/gtk/src/YGText.cc
trunk/gtk/src/YGUI.cc
trunk/gtk/src/ygtkrichtext.c
trunk/gtk/src/ygtkrichtext.h
Modified: trunk/gtk/ChangeLog
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/ChangeLog?rev=54011&r1=54010&r2=54011&view=diff
==============================================================================
--- trunk/gtk/ChangeLog (original)
+++ trunk/gtk/ChangeLog Wed Dec 10 01:14:59 2008
@@ -3,6 +3,9 @@
* src/ygtksteps.c: bug fix 457752: ensure space between tick and
text.
+ * src/ygtktextview.c: polishes read-only GtkTextView a little bit.
+ * src/YGText.cc & src/ygtkrichtext.c: use YGtkTextView.
+
2008-12-05 Ricardo Cruz
* src/YGPushButton.cc: bug fix 449320: for a vertical Box: either
Modified: trunk/gtk/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/Makefile.am?rev=54011&r1=54010&r2=54011&view=diff
==============================================================================
--- trunk/gtk/src/Makefile.am (original)
+++ trunk/gtk/src/Makefile.am Wed Dec 10 01:14:59 2008
@@ -67,6 +67,7 @@
ygtkhandlebox.c \
ygtklinklabel.c \
ygtktooltip.c \
+ ygtktextview.c \
ygtkrichtext.c \
yzyppwrapper.cc \
yzypptags.cc \
Modified: trunk/gtk/src/YGText.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGText.cc?rev=54011&r1=54010&r2=54011&view=diff
==============================================================================
--- trunk/gtk/src/YGText.cc (original)
+++ trunk/gtk/src/YGText.cc Wed Dec 10 01:14:59 2008
@@ -7,6 +7,7 @@
#include <string>
#include "YGUtils.h"
#include "YGWidget.h"
+#include "ygtktextview.h"
class YGTextView : public YGScrolledWidget
{
@@ -15,16 +16,12 @@
public:
YGTextView (YWidget *ywidget, YWidget *parent, const string &label, bool editable)
: YGScrolledWidget (ywidget, parent, label, YD_VERT,
- GTK_TYPE_TEXT_VIEW, "wrap-mode", GTK_WRAP_WORD_CHAR, NULL)
+ YGTK_TYPE_TEXT_VIEW, "wrap-mode", GTK_WRAP_WORD_CHAR,
+ "editable", editable, NULL)
{
IMPL
setPolicy (GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
-
maxChars = -1;
- if (!editable) {
- gtk_text_view_set_editable (GTK_TEXT_VIEW (getWidget()), FALSE);
- gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (getWidget()), FALSE);
- }
connect (G_OBJECT (getBuffer()), "changed",
G_CALLBACK (text_changed_cb), this);
Modified: trunk/gtk/src/YGUI.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGUI.cc?rev=54011&r1=54010&r2=54011&view=diff
==============================================================================
--- trunk/gtk/src/YGUI.cc (original)
+++ trunk/gtk/src/YGUI.cc Wed Dec 10 01:14:59 2008
@@ -754,6 +754,7 @@
}
#include
+#include "ygtktextview.h"
void dumpYastHtml (YWidget *widget)
{
@@ -768,10 +769,8 @@
if (rtext) {
std::string text = rtext->text();
- GtkWidget *view = gtk_text_view_new();
+ GtkWidget *view = ygtk_text_view_new (FALSE);
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (view), GTK_WRAP_WORD);
- gtk_text_view_set_editable (GTK_TEXT_VIEW (view), FALSE);
- gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (view), FALSE);
GtkTextBuffer *buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
gtk_text_buffer_set_text (buffer, text.c_str(), -1);
Modified: trunk/gtk/src/ygtkrichtext.c
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtkrichtext.c?rev=54011&r1=54010&r2=54011&view=diff
==============================================================================
--- trunk/gtk/src/ygtkrichtext.c (original)
+++ trunk/gtk/src/ygtkrichtext.c Wed Dec 10 01:14:59 2008
@@ -13,11 +13,10 @@
#define IDENT_MARGIN 20
#define PARAGRAPH_SPACING 12
-// convert liberal html to xhtml since we use a xhtml parser
-// convert liberal html to xhtml
+// convert liberal html to xhtml, as we use a xhtml parser
extern gchar *ygutils_convert_to_xhtml (const char *instr);
-G_DEFINE_TYPE (YGtkRichText, ygtk_rich_text, GTK_TYPE_TEXT_VIEW)
+G_DEFINE_TYPE (YGtkRichText, ygtk_rich_text, YGTK_TYPE_TEXT_VIEW)
static guint link_clicked_signal;
static GdkColor link_color = { 0, 0, 0, 0xeeee };
Modified: trunk/gtk/src/ygtkrichtext.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/ygtkrichtext.h?rev=54011&r1=54010&r2=54011&view=diff
==============================================================================
--- trunk/gtk/src/ygtkrichtext.h (original)
+++ trunk/gtk/src/ygtkrichtext.h Wed Dec 10 01:14:59 2008
@@ -10,7 +10,7 @@
#ifndef YGTK_RICH_TEXT_H
#define YGTK_RICH_TEXT_H
-#include
+#include "ygtktextview.h"
G_BEGIN_DECLS
#define YGTK_TYPE_RICH_TEXT (ygtk_rich_text_get_type ())
@@ -27,7 +27,7 @@
typedef struct _YGtkRichText
{
- GtkTextView parent;
+ YGtkTextView parent;
// members:
GdkCursor *hand_cursor;
GdkPixbuf *background_pixbuf;
@@ -35,7 +35,7 @@
typedef struct _YGtkRichTextClass
{
- GtkTextViewClass parent_class;
+ YGtkTextViewClass parent_class;
// signals:
void (*link_clicked) (YGtkRichText *rich_text, const gchar *link);
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org