diff options
author | Anatoly Spektor <aspektor@redhat.com> | 2013-02-07 15:35:15 -0500 |
---|---|---|
committer | Alexander Kurtakov <akurtako@redhat.com> | 2013-02-21 22:41:06 +0200 |
commit | a84e4f12000c77da8b885150e339fe7970a888cc (patch) | |
tree | ef43cf4d365f04ad97f9ce45d6d55711284bd7c9 | |
parent | afb266ef7daac7232bb418f80a463e022c156133 (diff) | |
download | eclipse.platform.swt-a84e4f12000c77da8b885150e339fe7970a888cc.tar.gz eclipse.platform.swt-a84e4f12000c77da8b885150e339fe7970a888cc.tar.xz eclipse.platform.swt-a84e4f12000c77da8b885150e339fe7970a888cc.zip |
This patch solves clipping and wrong default sizing of GtkEntry in GTK3
5 files changed, 28 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c index e96c1426d7..b579c98c0b 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c @@ -10027,6 +10027,16 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1entry_1set_1visibility) } #endif +#ifndef NO__1gtk_1entry_1set_1width_1chars +JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1entry_1set_1width_1chars) + (JNIEnv *env, jclass that, jintLong arg0, jint arg1) +{ + OS_NATIVE_ENTER(env, that, _1gtk_1entry_1set_1width_1chars_FUNC); + gtk_entry_set_width_chars((GtkEntry *)arg0, (gint)arg1); + OS_NATIVE_EXIT(env, that, _1gtk_1entry_1set_1width_1chars_FUNC); +} +#endif + #ifndef NO__1gtk_1entry_1text_1index_1to_1layout_1index JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1entry_1text_1index_1to_1layout_1index) (JNIEnv *env, jclass that, jintLong arg0, jint arg1) diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c index 4226bc99ef..cc331d41af 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c @@ -745,6 +745,7 @@ char * OS_nativeFunctionNames[] = { "_1gtk_1entry_1set_1placeholder_1text", "_1gtk_1entry_1set_1text", "_1gtk_1entry_1set_1visibility", + "_1gtk_1entry_1set_1width_1chars", "_1gtk_1entry_1text_1index_1to_1layout_1index", "_1gtk_1enumerate_1printers", "_1gtk_1expander_1get_1expanded", diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h index 91c52e6fdd..237c57eb64 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h @@ -755,6 +755,7 @@ typedef enum { _1gtk_1entry_1set_1placeholder_1text_FUNC, _1gtk_1entry_1set_1text_FUNC, _1gtk_1entry_1set_1visibility_FUNC, + _1gtk_1entry_1set_1width_1chars_FUNC, _1gtk_1entry_1text_1index_1to_1layout_1index_FUNC, _1gtk_1enumerate_1printers_FUNC, _1gtk_1expander_1get_1expanded_FUNC, diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java index f9e7110150..f5ab0781ac 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java @@ -7129,6 +7129,19 @@ public static final long /*int*/ gtk_entry_get_inner_border (long /*int*/ entry) lock.unlock(); } } +/** + * @param self cast=(GtkEntry *) + * @param n_chars cast=(gint) + */ +public static final native void _gtk_entry_set_width_chars (long /*int*/ self, int n_chars); +public static final void gtk_entry_set_width_chars (long /*int*/ self, int n_chars) { + lock.lock(); + try { + _gtk_entry_set_width_chars(self, n_chars); + } finally { + lock.unlock(); + } +} /** @param entry cast=(GtkEntry *) */ public static final native char _gtk_entry_get_invisible_char(long /*int*/ entry); public static final char gtk_entry_get_invisible_char(long /*int*/ entry) { diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java index db9f4d1201..46cf274a2f 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java @@ -232,6 +232,9 @@ void createHandle (int index) { } if (OS.GTK3) { imContext = OS.imContextLast(); + if ((style & SWT.SINGLE) != 0) { + OS.gtk_entry_set_width_chars(handle, 6); + } } } |