headerbar: Show title buttons by default

Most of the time show-title-buttons is set to TRUE. Go ahead and make that
the default.
This commit is contained in:
Alexander Mikhaylenko 2020-05-25 20:14:58 +05:00
parent 988901294d
commit 7c3b30036e
50 changed files with 16 additions and 56 deletions

View File

@ -9,7 +9,6 @@
<property name="default-height">768</property>
<child type="titlebar">
<object class="GtkHeaderBar" id="header">
<property name="show-title-buttons">1</property>
<child type="start">
<object class="GtkButton">
<property name="icon-name">document-open-symbolic</property>

View File

@ -6,7 +6,6 @@
<property name="default-height">400</property>
<child type="titlebar">
<object class="GtkHeaderBar" id="">
<property name="show-title-buttons">1</property>
<child>
<object class="GtkBox">
<style>

View File

@ -7,7 +7,6 @@
<property name="title">Font Explorer</property>
<child type="titlebar">
<object class="GtkHeaderBar">
<property name="show-title-buttons">1</property>
<child>
<object class="GtkButton" id="reset">
<property name="receives-default">1</property>

View File

@ -30,7 +30,6 @@ do_headerbar (GtkWidget *do_widget)
gtk_window_set_default_size (GTK_WINDOW (window), 600, 400);
header = gtk_header_bar_new ();
gtk_header_bar_set_show_title_buttons (GTK_HEADER_BAR (header), TRUE);
button = gtk_button_new ();
icon = g_themed_icon_new ("mail-send-receive-symbolic");

View File

@ -6,7 +6,6 @@
<property name="default-height">500</property>
<child type="titlebar">
<object class="GtkHeaderBar">
<property name="show-title-buttons">1</property>
<child>
<object class="GtkBox">
<style>

View File

@ -801,7 +801,6 @@ do_listview_colors (GtkWidget *do_widget)
window = gtk_window_new ();
gtk_window_set_title (GTK_WINDOW (window), "Colors");
header = gtk_header_bar_new ();
gtk_header_bar_set_show_title_buttons (GTK_HEADER_BAR (header), TRUE);
gtk_window_set_titlebar (GTK_WINDOW (window), header);
gtk_window_set_default_size (GTK_WINDOW (window), 600, 400);

View File

@ -174,7 +174,6 @@
<property name="default-height">400</property>
<child type="titlebar">
<object class="GtkHeaderBar" id="">
<property name="show-title-buttons">1</property>
<child>
<object class="GtkButton">
<property name="icon-name">go-up-symbolic</property>

View File

@ -6,7 +6,6 @@
<property name="title" translatable="yes">Minesweeper</property>
<child type="titlebar">
<object class="GtkHeaderBar" id="">
<property name="show-title-buttons">1</property>
<child>
<object class="GtkButton">
<property name="label">New Game</property>

View File

@ -6,7 +6,6 @@
<property name="default-height">480</property>
<child type="titlebar">
<object class="GtkHeaderBar">
<property name="show-title-buttons">1</property>
<child type="end">
<object class="GtkToggleButton" id="search_button">
<property name="icon-name">system-search-symbolic</property>

View File

@ -24,7 +24,6 @@
<property name="default-height">600</property>
<child type="titlebar">
<object class="GtkHeaderBar" id="headerbar">
<property name="show-title-buttons">1</property>
<child>
<object class="GtkButton">
<property name="valign">center</property>

View File

@ -69,7 +69,6 @@ do_markup (GtkWidget *do_widget)
g_signal_connect (show_source, "toggled", G_CALLBACK (source_toggled), stack);
header = gtk_header_bar_new ();
gtk_header_bar_set_show_title_buttons (GTK_HEADER_BAR (header), TRUE);
gtk_header_bar_pack_start (GTK_HEADER_BAR (header), show_source);
gtk_window_set_titlebar (GTK_WINDOW (window), header);

View File

@ -4,9 +4,7 @@
<property name="title" translatable="yes">Model Button</property>
<property name="resizable">0</property>
<child type="titlebar">
<object class="GtkHeaderBar">
<property name="show-title-buttons">1</property>
</object>
<object class="GtkHeaderBar"/>
</child>
<child>
<object class="GtkBox">

View File

@ -392,7 +392,6 @@ do_paint (GtkWidget *toplevel)
gtk_window_set_child (GTK_WINDOW (window), draw_area);
headerbar = gtk_header_bar_new ();
gtk_header_bar_set_show_title_buttons (GTK_HEADER_BAR (headerbar), TRUE);
colorbutton = gtk_color_button_new ();
g_signal_connect (colorbutton, "color-set",

View File

@ -276,7 +276,6 @@ do_peg_solitaire (GtkWidget *do_widget)
g_signal_connect (restart, "clicked", G_CALLBACK (restart), NULL);
header = gtk_header_bar_new ();
gtk_header_bar_set_show_title_buttons (GTK_HEADER_BAR (header), TRUE);
gtk_header_bar_pack_start (GTK_HEADER_BAR (header), restart);
window = gtk_window_new ();
gtk_window_set_display (GTK_WINDOW (window),

View File

@ -40,7 +40,6 @@ do_sidebar (GtkWidget *do_widget)
gtk_widget_set_size_request (window, 500, 350);
header = gtk_header_bar_new ();
gtk_header_bar_set_show_title_buttons (GTK_HEADER_BAR(header), TRUE);
gtk_window_set_titlebar (GTK_WINDOW(window), header);
gtk_window_set_title (GTK_WINDOW(window), "Stack Sidebar");
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);

View File

@ -470,7 +470,6 @@ do_sliding_puzzle (GtkWidget *do_widget)
g_signal_connect (restart, "clicked", G_CALLBACK (reshuffle), NULL);
header = gtk_header_bar_new ();
gtk_header_bar_set_show_title_buttons (GTK_HEADER_BAR (header), TRUE);
gtk_header_bar_pack_start (GTK_HEADER_BAR (header), restart);
gtk_header_bar_pack_end (GTK_HEADER_BAR (header), tweak);
window = gtk_window_new ();

View File

@ -4,7 +4,6 @@
<property name="resizable">0</property>
<child type="titlebar">
<object class="GtkHeaderBar" id="header">
<property name="show-title-buttons">1</property>
<child type="start">
<object class="GtkToggleButton" id="toggle">
<property name="label">Cycle</property>

View File

@ -73,7 +73,6 @@ do_video_player (GtkWidget *do_widget)
gtk_window_set_child (GTK_WINDOW (window), video);
title = gtk_header_bar_new ();
gtk_header_bar_set_show_title_buttons (GTK_HEADER_BAR (title), TRUE);
gtk_window_set_titlebar (GTK_WINDOW (window), title);
open_button = gtk_button_new_with_mnemonic ("_Open");

View File

@ -21,7 +21,6 @@
<property name="default-height">768</property>
<child type="titlebar">
<object class="GtkHeaderBar" id="header">
<property name="show-title-buttons">1</property>
<child type="title">
<object class="GtkBox">
<style>

View File

@ -103,7 +103,6 @@
<property name="focus-widget">text_view</property>
<child type="titlebar">
<object class="GtkHeaderBar" id="header">
<property name="show-title-buttons">1</property>
<child type="start">
<object class="GtkButton">
<property name="icon-name">document-open-symbolic</property>

View File

@ -436,7 +436,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="title">GTK Widget Factory</property>
<child type="titlebar">
<object class="GtkHeaderBar" id="headerbar1">
<property name="show-title-buttons">1</property>
<child type="title">
<object class="GtkStackSwitcher" id="stack_switcher">
<property name="stack">toplevel_stack</property>

View File

@ -1423,7 +1423,6 @@ the search bar below the header bar.
<property name="default-height">400</property>
<child type="titlebar">
<object class="GtkHeaderBar" id="header">
<property name="show-title-buttons">1</property>
<child type="title">
<object class="GtkStackSwitcher" id="tabs">
<property name="stack">stack</property>
@ -1537,7 +1536,6 @@ GtkMenuButton, GtkRevealer and GtkListBox.
<property name="default-height">400</property>
<child type="titlebar">
<object class="GtkHeaderBar" id="header">
<property name="show-title-buttons">1</property>
<child type="title">
<object class="GtkStackSwitcher" id="tabs">
<property name="stack">stack</property>

View File

@ -411,6 +411,7 @@ and gtk_box_append(). You can also reorder box children as necessary.
The gtk_header_bar_set_show_close_button() function has been renamed to
the more accurate name gtk_header_bar_set_show_title_buttons(). The
corresponding getter and the property itself have also been renamed.
The default value of the property is now %TRUE instead of %FALSE.
The gtk_header_bar_set_custom_title() function has been renamed to
the more accurate name gtk_header_bar_set_title_widget(). The

View File

@ -6,7 +6,6 @@
<property name="default-height">400</property>
<child type="titlebar">
<object class="GtkHeaderBar" id="header">
<property name="show-title-buttons">1</property>
<child type="title">
<object class="GtkStackSwitcher" id="tabs">
<property name="stack">stack</property>

View File

@ -6,7 +6,6 @@
<property name="default-height">400</property>
<child type="titlebar">
<object class="GtkHeaderBar" id="header">
<property name="show-title-buttons">1</property>
<child type="title">
<object class="GtkStackSwitcher" id="tabs">
<property name="stack">stack</property>

View File

@ -6,7 +6,6 @@
<property name="default-height">400</property>
<child type="titlebar">
<object class="GtkHeaderBar" id="header">
<property name="show-title-buttons">1</property>
<child type="title">
<object class="GtkStackSwitcher" id="tabs">
<property name="stack">stack</property>

View File

@ -6,7 +6,6 @@
<property name="default-height">400</property>
<child type="titlebar">
<object class="GtkHeaderBar" id="header">
<property name="show-title-buttons">1</property>
<child type="title">
<object class="GtkStackSwitcher" id="tabs">
<property name="stack">stack</property>

View File

@ -6,7 +6,6 @@
<property name="default-height">400</property>
<child type="titlebar">
<object class="GtkHeaderBar" id="header">
<property name="show-title-buttons">1</property>
<child type="title">
<object class="GtkStackSwitcher" id="tabs">
<property name="stack">stack</property>

View File

@ -6,7 +6,6 @@
<property name="default-height">400</property>
<child type="titlebar">
<object class="GtkHeaderBar" id="header">
<property name="show-title-buttons">1</property>
<child type="title">
<object class="GtkStackSwitcher" id="tabs">
<property name="stack">stack</property>

View File

@ -6,7 +6,6 @@
<property name="default-height">400</property>
<child type="titlebar">
<object class="GtkHeaderBar" id="header">
<property name="show-title-buttons">1</property>
<child>
<object class="GtkLabel" id="lines_label">
<property name="visible">0</property>

View File

@ -15,7 +15,6 @@ new_window (GApplication *app,
gtk_window_set_icon_name (GTK_WINDOW (window), "sunny");
header = gtk_header_bar_new ();
gtk_header_bar_set_show_title_buttons (GTK_HEADER_BAR (header), TRUE);
gtk_window_set_titlebar (GTK_WINDOW (window), header);
overlay = gtk_overlay_new ();

View File

@ -595,7 +595,7 @@ gtk_header_bar_class_init (GtkHeaderBarClass *class)
g_param_spec_boolean ("show-title-buttons",
P_("Show title buttons"),
P_("Whether to show title buttons"),
FALSE,
TRUE,
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
/**
@ -629,6 +629,7 @@ gtk_header_bar_init (GtkHeaderBar *bar)
priv->title_widget = NULL;
priv->decoration_layout = NULL;
priv->show_title_buttons = TRUE;
priv->state = GDK_SURFACE_STATE_WITHDRAWN;
priv->handle = gtk_window_handle_new ();
@ -646,6 +647,7 @@ gtk_header_bar_init (GtkHeaderBar *bar)
gtk_center_box_set_end_widget (GTK_CENTER_BOX (priv->center_box), priv->end_box);
construct_title_label (bar);
create_window_controls (bar);
}
static GtkBuildableIface *parent_buildable_iface;

View File

@ -860,9 +860,7 @@ gtk_shortcuts_window_init (GtkShortcutsWindow *self)
priv->search_text_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
priv->search_image_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
priv->header_bar = g_object_new (GTK_TYPE_HEADER_BAR,
"show-title-buttons", TRUE,
NULL);
priv->header_bar = GTK_HEADER_BAR (gtk_header_bar_new ());
gtk_window_set_titlebar (GTK_WINDOW (self), GTK_WIDGET (priv->header_bar));
search_button = g_object_new (GTK_TYPE_TOGGLE_BUTTON,

View File

@ -4308,7 +4308,6 @@ gtk_window_realize (GtkWidget *widget)
if (priv->title_box == NULL)
{
priv->titlebar = gtk_header_bar_new ();
gtk_header_bar_set_show_title_buttons (GTK_HEADER_BAR (priv->titlebar), TRUE);
gtk_widget_add_css_class (priv->titlebar, GTK_STYLE_CLASS_TITLEBAR);
gtk_widget_add_css_class (priv->titlebar, "default-decoration");

View File

@ -12,7 +12,6 @@
<property name="default-width">800</property>
<child type="titlebar">
<object class="GtkHeaderBar">
<property name="show-title-buttons">1</property>
<child>
<object class="GtkStack" id="button_stack">
<property name="visible-child-name" bind-source="top_stack" bind-property="visible-child-name"/>

View File

@ -4,7 +4,6 @@
<property name="resizable">0</property>
<child internal-child="headerbar">
<object class="GtkHeaderBar" id="headerbar1">
<property name="show-title-buttons">1</property>
<child type="title">
<object class="GtkStackSwitcher" id="stack_switcher">
<property name="visible">0</property>

View File

@ -2,7 +2,9 @@
<interface domain="gtk40">
<template class="GtkAssistant" parent="GtkWindow">
<child type="titlebar">
<object class="GtkHeaderBar" id="headerbar"/>
<object class="GtkHeaderBar" id="headerbar">
<property name="show-title-buttons">0</property>
</object>
</child>
<child>
<object class="GtkBox" id="main_box">

View File

@ -2,9 +2,7 @@
<interface domain="gtk40">
<template class="GtkDialog" parent="GtkWindow">
<child type="titlebar">
<object class="GtkHeaderBar" id="headerbar">
<property name="show-title-buttons">1</property>
</object>
<object class="GtkHeaderBar" id="headerbar"/>
</child>
<child>
<object class="GtkBox">

View File

@ -4,7 +4,9 @@
<property name="title"></property>
<property name="resizable">0</property>
<child internal-child="headerbar">
<object class="GtkHeaderBar" id="headerbar1"/>
<object class="GtkHeaderBar" id="headerbar1">
<property name="show-title-buttons">0</property>
</object>
</child>
<child internal-child="content_area">
<object class="GtkBox" id="dialog-vbox1">

View File

@ -18,6 +18,7 @@
<property name="title" translatable="yes">Join Chat Room</property>
<child type="titlebar">
<object class="GtkHeaderBar" id="titlebar">
<property name="show-title-buttons">0</property>
<child>
<object class="GtkButton" id="back_button">
<property name="visible">0</property>

View File

@ -51,7 +51,6 @@ create_headerbar_as_titlebar (GtkApplication *app)
gtk_window_set_title (GTK_WINDOW (window), "Headerbar as titlebar");
header = gtk_header_bar_new ();
gtk_header_bar_set_show_title_buttons (GTK_HEADER_BAR (header), TRUE);
gtk_window_set_titlebar (GTK_WINDOW (window), header);
label = gtk_label_new ("This window has a headerbar set as a titlebar");
@ -74,7 +73,6 @@ create_headerbar_inside_window (GtkApplication *app)
gtk_window_set_child (GTK_WINDOW (window), box);
header = gtk_header_bar_new ();
gtk_header_bar_set_show_title_buttons (GTK_HEADER_BAR (header), TRUE);
gtk_box_append (GTK_BOX (box), header);
label = gtk_label_new ("This window has a headerbar inside the window and no titlebar");
@ -98,7 +96,6 @@ create_headerbar_overlay (GtkApplication *app)
gtk_window_set_child (GTK_WINDOW (window), overlay);
header = gtk_header_bar_new ();
gtk_header_bar_set_show_title_buttons (GTK_HEADER_BAR (header), TRUE);
gtk_widget_set_valign (header, GTK_ALIGN_START);
gtk_overlay_add_overlay (GTK_OVERLAY (overlay), header);
load_css (header, "headerbar { background: alpha(shade(@theme_bg_color, .9), .8); }");
@ -150,7 +147,6 @@ create_hiding_headerbar (GtkApplication *app)
gtk_box_append (GTK_BOX (box), revealer);
header = gtk_header_bar_new ();
gtk_header_bar_set_show_title_buttons (GTK_HEADER_BAR (header), TRUE);
gtk_revealer_set_child (GTK_REVEALER (revealer), header);
label = gtk_label_new ("This window's headerbar can be shown and hidden with animation");

View File

@ -73,7 +73,6 @@ main (int argc, char *argv[])
win = gtk_window_new ();
gtk_window_set_default_size (GTK_WINDOW (win), 400, 600);
header_bar = gtk_header_bar_new ();
gtk_header_bar_set_show_title_buttons (GTK_HEADER_BAR (header_bar), TRUE);
gtk_window_set_titlebar (GTK_WINDOW (win), header_bar);
gtk_window_set_title (GTK_WINDOW (win), "Test GtkPopover");
actions = g_simple_action_group_new ();

View File

@ -20,7 +20,6 @@ on_activate (GApplication *app,
/* titlebar */
header = gtk_header_bar_new ();
gtk_header_bar_set_show_title_buttons (GTK_HEADER_BAR (header), TRUE);
gtk_window_set_titlebar (GTK_WINDOW (window), header);
sidebar_toggle = gtk_toggle_button_new_with_label ("Show Sidebar");

View File

@ -315,7 +315,6 @@ main (int argc, char **argv)
titlebar = gtk_header_bar_new ();
gtk_window_set_titlebar (GTK_WINDOW (window), titlebar);
gtk_header_bar_set_show_title_buttons (GTK_HEADER_BAR (titlebar), TRUE);
toggle_button = gtk_toggle_button_new ();
gtk_button_set_label (GTK_BUTTON (toggle_button), "Picking");

View File

@ -2,6 +2,7 @@
<object class="GtkWindow" id="window1">
<child>
<object class="GtkHeaderBar" id="headerbar1">
<property name="show-title-buttons">0</property>
<child type="start">
<object class="GtkButton" id="button1">
<property name="label" translatable="yes">Yes</property>

View File

@ -3,6 +3,7 @@
<object class="GtkApplicationWindow" id="window1">
<child type="titlebar">
<object class="GtkHeaderBar">
<property name="show-title-buttons">0</property>
<child type="title">
<object class="GtkStackSwitcher" id="stack_switcher">
<property name="stack">toplevel_stack</property>

View File

@ -439,7 +439,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="title">GTK Widget Factory</property>
<child type="titlebar">
<object class="GtkHeaderBar" id="headerbar1">
<property name="show-title-buttons">1</property>
<child type="title">
<object class="GtkStackSwitcher" id="stack_switcher">
<property name="stack">toplevel_stack</property>

View File

@ -439,7 +439,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="title">GTK Widget Factory</property>
<child type="titlebar">
<object class="GtkHeaderBar" id="headerbar1">
<property name="show-title-buttons">1</property>
<child type="title">
<object class="GtkStackSwitcher" id="stack_switcher">
<property name="stack">toplevel_stack</property>

View File

@ -439,7 +439,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
<property name="title">GTK Widget Factory</property>
<child type="titlebar">
<object class="GtkHeaderBar" id="headerbar1">
<property name="show-title-buttons">1</property>
<child type="title">
<object class="GtkStackSwitcher" id="stack_switcher">
<property name="stack">toplevel_stack</property>

View File

@ -3,7 +3,6 @@
<object class="GtkWindow" id="window1">
<child type="titlebar">
<object class="GtkHeaderBar" id="headerbar1">
<property name="show-title-buttons">1</property>
<property name="title-widget">box1</property>
</object>
</child>