WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-211412-20200505031555.patch (text/plain), 3.59 KB, created by
Adrian Perez
on 2020-05-04 17:15:57 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Adrian Perez
Created:
2020-05-04 17:15:57 PDT
Size:
3.59 KB
patch
obsolete
>Subversion Revision: 261081 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 7462fdd7d013c36ea732fafd10809032a584fd55..b9dcdaa7f4375a101589a572abc90c8f71c1b678 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,17 @@ >+2020-05-04 Adrian Perez de Castro <aperez@igalia.com> >+ >+ [GTK4] Header bars no longer have title and subtitle properties >+ https://bugs.webkit.org/show_bug.cgi?id=211412 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ No new tests needed. >+ >+ * UIProcess/Inspector/gtk/WebKitInspectorWindow.cpp: For GTK4 use a vertical >+ box as title widget, with two labels acting as title and subtitle. >+ (webkit_inspector_window_init): >+ (webkitInspectorWindowSetSubtitle): >+ > 2020-05-04 Yusuke Suzuki <ysuzuki@apple.com> > > Unreviewed, speculative build fix for r261071 >diff --git a/Source/WebKit/UIProcess/Inspector/gtk/WebKitInspectorWindow.cpp b/Source/WebKit/UIProcess/Inspector/gtk/WebKitInspectorWindow.cpp >index d8b6936caaa05691721894c085061f36a9269ac3..f0020cf660c29cf6e57ce798ed4bc71e352111c2 100644 >--- a/Source/WebKit/UIProcess/Inspector/gtk/WebKitInspectorWindow.cpp >+++ b/Source/WebKit/UIProcess/Inspector/gtk/WebKitInspectorWindow.cpp >@@ -36,6 +36,10 @@ struct _WebKitInspectorWindow { > GtkWindow parent; > > GtkWidget* headerBar; >+ >+#if USE(GTK4) >+ GtkWidget* subtitleLabel; >+#endif > }; > > struct _WebKitInspectorWindowClass { >@@ -51,12 +55,34 @@ static void webkit_inspector_window_class_init(WebKitInspectorWindowClass*) > static void webkit_inspector_window_init(WebKitInspectorWindow* window) > { > window->headerBar = gtk_header_bar_new(); >+ >+#if USE(GTK4) >+ GtkWidget* box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); >+ gtk_widget_set_valign(box, GTK_ALIGN_CENTER); >+ >+ GtkWidget* titleLabel = gtk_label_new(_("Web Inspector")); >+ gtk_widget_set_halign(titleLabel, GTK_ALIGN_CENTER); >+ gtk_label_set_single_line_mode(GTK_LABEL(titleLabel), TRUE); >+ gtk_label_set_ellipsize(GTK_LABEL(titleLabel), PANGO_ELLIPSIZE_END); >+ gtk_widget_add_css_class(titleLabel, GTK_STYLE_CLASS_TITLE); >+ gtk_widget_set_parent(titleLabel, box); >+ >+ window->subtitleLabel = gtk_label_new(nullptr); >+ gtk_widget_set_halign(window->subtitleLabel, GTK_ALIGN_CENTER); >+ gtk_label_set_single_line_mode(GTK_LABEL(window->subtitleLabel), TRUE); >+ gtk_label_set_ellipsize(GTK_LABEL(window->subtitleLabel), PANGO_ELLIPSIZE_END); >+ gtk_widget_add_css_class(window->subtitleLabel, GTK_STYLE_CLASS_SUBTITLE); >+ gtk_widget_set_parent(window->subtitleLabel, box); >+ gtk_widget_hide(window->subtitleLabel); >+ >+ gtk_header_bar_set_title_widget(GTK_HEADER_BAR(window->headerBar), box); >+#else > gtk_header_bar_set_title(GTK_HEADER_BAR(window->headerBar), _("Web Inspector")); >-#if !USE(GTK4) > gtk_header_bar_set_show_close_button(GTK_HEADER_BAR(window->headerBar), TRUE); >-#endif >- gtk_window_set_titlebar(GTK_WINDOW(window), window->headerBar); > gtk_widget_show(window->headerBar); >+#endif // USE(GTK4) >+ >+ gtk_window_set_titlebar(GTK_WINDOW(window), window->headerBar); > } > > GtkWidget* webkitInspectorWindowNew() >@@ -72,5 +98,13 @@ void webkitInspectorWindowSetSubtitle(WebKitInspectorWindow* window, const char* > { > g_return_if_fail(WEBKIT_IS_INSPECTOR_WINDOW(window)); > >+#if USE(GTK4) >+ if (subtitle) { >+ gtk_label_set_text(GTK_LABEL(window->subtitleLabel), subtitle); >+ gtk_widget_show(window->subtitleLabel); >+ } else >+ gtk_widget_hide(window->subtitleLabel); >+#else > gtk_header_bar_set_subtitle(GTK_HEADER_BAR(window->headerBar), subtitle); >+#endif // USE(GTK4) > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 211412
: 398438