diff options
author | CoprDistGit <infra@openeuler.org> | 2023-09-19 03:19:34 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2023-09-19 03:19:34 +0000 |
commit | e9f07e4582f7977395d5c26d41e3fc97ed9e077c (patch) | |
tree | 478a9376a299c9450151b72c29c5c790c1023564 /hide-help-button.patch | |
parent | a4252603249fd648f2870ce2dcbaf86ebcf1f118 (diff) |
automatic import of anacondaopeneuler20.03
Diffstat (limited to 'hide-help-button.patch')
-rw-r--r-- | hide-help-button.patch | 131 |
1 files changed, 131 insertions, 0 deletions
diff --git a/hide-help-button.patch b/hide-help-button.patch new file mode 100644 index 0000000..fec4d90 --- /dev/null +++ b/hide-help-button.patch @@ -0,0 +1,131 @@ +From cf192d77045b8aeb8cdcd55c98a93ad64fea3c3b Mon Sep 17 00:00:00 2001 +From: t_feng <fengtao40@huawei.com> +Date: Fri, 19 Jun 2020 09:20:14 +0800 +Subject: [PATCH] hide help button + +--- + data/tmux.conf | 3 +-- + pyanaconda/ui/gui/__init__.py | 27 --------------------------- + widgets/src/BaseWindow.c | 21 --------------------- + 3 files changed, 1 insertion(+), 50 deletions(-) + +diff --git a/data/tmux.conf b/data/tmux.conf +index 87c9cb7..63240f7 100644 +--- a/data/tmux.conf ++++ b/data/tmux.conf +@@ -1,7 +1,6 @@ + # tmux.conf for the anaconda environment + + bind -n M-tab next +-bind -n F1 list-keys + + set-option -s exit-unattached off + set-option -g base-index 1 +@@ -25,7 +24,7 @@ set-option -g history-limit 10000 + # then re-attach to it in the tmux service run on the console tty. + new-session -d -s anaconda -n main anaconda + +-set-option status-right '#[fg=blue]#(echo -n "Switch tab: Alt+Tab | Help: F1 ")' ++set-option status-right '#[fg=blue]#(echo -n "Switch tab: Alt+Tab ")' + + new-window -d -n shell "bash --login" + new-window -d -n log "tail -F /tmp/anaconda.log" +diff --git a/pyanaconda/ui/gui/__init__.py b/pyanaconda/ui/gui/__init__.py +index 06373d9..6a6e3b9 100644 +--- a/pyanaconda/ui/gui/__init__.py ++++ b/pyanaconda/ui/gui/__init__.py +@@ -443,20 +443,6 @@ class MainWindow(Gtk.Window): + # Return False to indicate that the child allocation is not yet set + return False + +- def _on_mnemonics_visible_changed(self, window, property_type, obj): +- # mnemonics display has been activated or deactivated, +- # add or remove the F1 mnemonics display from the help button +- help_button = obj.window.get_help_button() +- if window.props.mnemonics_visible: +- # save current label +- old_label = help_button.get_label() +- self._saved_help_button_label = old_label +- # add the (F1) "mnemonics" to the help button +- help_button.set_label("%s (F1)" % old_label) +- else: +- # restore the old label +- help_button.set_label(self._saved_help_button_label) +- + def _on_child_added(self, widget, user_data): + # If this is GtkLabel, apply the language attribute + if isinstance(widget, Gtk.Label): +@@ -480,8 +466,6 @@ class MainWindow(Gtk.Window): + old_screen = self._stack.get_visible_child() + if old_screen: + old_screen.remove_accelerator(self._accel_group, Gdk.KEY_F12, 0) +- old_screen.remove_accelerator(self._accel_group, Gdk.KEY_F1, 0) +- old_screen.remove_accelerator(self._accel_group, Gdk.KEY_F1, Gdk.ModifierType.MOD1_MASK) + + # Check if the widget is already on the stack + if child not in self._stack_contents: +@@ -498,17 +482,6 @@ class MainWindow(Gtk.Window): + child.window.add_accelerator("button-clicked", self._accel_group, + Gdk.KEY_F12, 0, 0) + +- # Configure the help button +- child.window.add_accelerator("help-button-clicked", self._accel_group, +- Gdk.KEY_F1, 0, 0) +- child.window.add_accelerator("help-button-clicked", self._accel_group, +- Gdk.KEY_F1, Gdk.ModifierType.MOD1_MASK, 0) +- +- # Connect to mnemonics-visible to add the (F1) mnemonic to the button label +- if self._mnemonic_signal: +- self.disconnect(self._mnemonic_signal) +- self._mnemonic_signal = self.connect("notify::mnemonics-visible", self._on_mnemonics_visible_changed, child) +- + self._stack.set_visible_child(child.window) + + if child.focusWidgetName: +diff --git a/widgets/src/BaseWindow.c b/widgets/src/BaseWindow.c +index 6a1e372..203d4a7 100644 +--- a/widgets/src/BaseWindow.c ++++ b/widgets/src/BaseWindow.c +@@ -393,30 +393,11 @@ G_GNUC_END_IGNORE_DEPRECATIONS + gtk_widget_set_margin_top(win->priv->layout_indicator, 6); + gtk_widget_set_margin_bottom(win->priv->layout_indicator, 6); + +- /* Create the help button. */ +- win->priv->help_button = gtk_button_new_with_label(_(HELP_BUTTON_LABEL)); +- gtk_widget_set_halign(win->priv->help_button, GTK_ALIGN_END); +- gtk_widget_set_vexpand(win->priv->help_button, FALSE); +- gtk_widget_set_valign(win->priv->help_button, GTK_ALIGN_END); +- gtk_widget_set_margin_bottom(win->priv->help_button, 6); +- gtk_widget_set_name(win->priv->help_button, "anaconda-help-button"); +- +- atk = gtk_widget_get_accessible(win->priv->help_button); +- atk_object_set_name(atk, _(HELP_BUTTON_LABEL)); +- +- /* Hook up some signals for that button. The signal handlers here will +- * just raise our own custom signals for the whole window. +- */ +- g_signal_connect(win->priv->help_button, "clicked", +- G_CALLBACK(anaconda_base_window_help_button_clicked), win); +- +- + /* Add everything to the nav area. */ + gtk_grid_attach(GTK_GRID(win->priv->nav_area), win->priv->name_label, 0, 0, 1, 1); + gtk_grid_attach(GTK_GRID(win->priv->nav_area), win->priv->distro_label, 1, 0, 2, 1); + gtk_grid_attach(GTK_GRID(win->priv->nav_area), win->priv->beta_label, 1, 1, 1, 1); + gtk_grid_attach(GTK_GRID(win->priv->nav_area), win->priv->layout_indicator, 1, 2, 1, 1); +- gtk_grid_attach(GTK_GRID(win->priv->nav_area), win->priv->help_button, 2, 1, 1, 2); + + /* Last thing for the main_box is a revealer for the info bar */ + win->priv->info_revealer = gtk_revealer_new(); +@@ -832,8 +813,6 @@ void anaconda_base_window_retranslate(AnacondaBaseWindow *win) { + + gtk_label_set_text(GTK_LABEL(win->priv->beta_label), _(win->priv->orig_beta)); + +- gtk_button_set_label(GTK_BUTTON(win->priv->help_button), _(HELP_BUTTON_LABEL)); +- + /* retranslate the layout indicator */ + anaconda_layout_indicator_retranslate(ANACONDA_LAYOUT_INDICATOR(win->priv->layout_indicator)); + } +-- +2.23.0 + |