Replace most uses of <Primary> with <Control>

The only place where we are still using <Primary> is
in tests, to ensure we keep parsing it. Otherwise,
<Control> is now the preferred syntax.
This commit is contained in:
Matthias Clasen 2020-04-06 17:05:52 -04:00
parent 2486f46c0b
commit 0b17658a82
8 changed files with 52 additions and 52 deletions

View File

@ -11,7 +11,7 @@
<item>
<attribute name="label" translatable="yes">_Quit</attribute>
<attribute name="action">app.quit</attribute>
<attribute name="accel">&lt;Primary&gt;q</attribute>
<attribute name="accel">&lt;Control&gt;q</attribute>
</item>
</section>
</menu>

View File

@ -29,29 +29,29 @@
<item>
<attribute name="label" translatable="yes">_New</attribute>
<attribute name="action">win.new</attribute>
<attribute name="accel">&lt;Primary&gt;n</attribute>
<attribute name="accel">&lt;Control&gt;n</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Open</attribute>
<attribute name="action">win.open</attribute>
<attribute name="accel">&lt;Primary&gt;o</attribute>
<attribute name="accel">&lt;Control&gt;o</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Save</attribute>
<attribute name="action">win.save</attribute>
<attribute name="accel">&lt;Primary&gt;s</attribute>
<attribute name="accel">&lt;Control&gt;s</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Save _As</attribute>
<attribute name="action">win.save-as</attribute>
<attribute name="accel">&lt;Primary&gt;q</attribute>
<attribute name="accel">&lt;Control&gt;q</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">_Quit</attribute>
<attribute name="action">win.quit</attribute>
<attribute name="accel">&lt;Primary&gt;&lt;Shift&gt;s</attribute>
<attribute name="accel">&lt;Control&gt;&lt;Shift&gt;s</attribute>
</item>
</section>
</submenu>
@ -61,17 +61,17 @@
<item>
<attribute name="label" translatable="yes">_Copy</attribute>
<attribute name="action">win.copy</attribute>
<attribute name="accel">&lt;Primary&gt;c</attribute>
<attribute name="accel">&lt;Control&gt;c</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Cut</attribute>
<attribute name="action">win.cut</attribute>
<attribute name="accel">&lt;Primary&gt;x</attribute>
<attribute name="accel">&lt;Control&gt;x</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Paste</attribute>
<attribute name="action">win.paste</attribute>
<attribute name="accel">&lt;Primary&gt;v</attribute>
<attribute name="accel">&lt;Control&gt;v</attribute>
</item>
</section>
</submenu>

View File

@ -5,7 +5,7 @@
<item>
<attribute name="label" translatable="yes">_New</attribute>
<attribute name="action">app.new</attribute>
<attribute name="accel">&lt;Primary&gt;n</attribute>
<attribute name="accel">&lt;Control&gt;n</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Open</attribute>
@ -14,19 +14,19 @@
<item>
<attribute name="label" translatable="yes">_Save</attribute>
<attribute name="action">app.save</attribute>
<attribute name="accel">&lt;Primary&gt;s</attribute>
<attribute name="accel">&lt;Control&gt;s</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Save _As...</attribute>
<attribute name="action">app.save-as</attribute>
<attribute name="accel">&lt;Primary&gt;s</attribute>
<attribute name="accel">&lt;Control&gt;s</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">_Quit</attribute>
<attribute name="action">app.quit</attribute>
<attribute name="accel">&lt;Primary&gt;q</attribute>
<attribute name="accel">&lt;Control&gt;q</attribute>
</item>
</section>
</menu>
@ -45,19 +45,19 @@
<attribute name="label" translatable="yes">_Red</attribute>
<attribute name="action">app.color</attribute>
<attribute name="target">red</attribute>
<attribute name="accel">&lt;Primary&gt;r</attribute>
<attribute name="accel">&lt;Control&gt;r</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Green</attribute>
<attribute name="action">app.color</attribute>
<attribute name="target">green</attribute>
<attribute name="accel">&lt;Primary&gt;g</attribute>
<attribute name="accel">&lt;Control&gt;g</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Blue</attribute>
<attribute name="action">app.color</attribute>
<attribute name="target">blue</attribute>
<attribute name="accel">&lt;Primary&gt;b</attribute>
<attribute name="accel">&lt;Control&gt;b</attribute>
</item>
</section>
</submenu>
@ -68,26 +68,26 @@
<attribute name="label" translatable="yes">_Square</attribute>
<attribute name="action">win.shape</attribute>
<attribute name="target">square</attribute>
<attribute name="accel">&lt;Primary&gt;s</attribute>
<attribute name="accel">&lt;Control&gt;s</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Rectangle</attribute>
<attribute name="action">win.shape</attribute>
<attribute name="target">rectangle</attribute>
<attribute name="accel">&lt;Primary&gt;r</attribute>
<attribute name="accel">&lt;Control&gt;r</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Oval</attribute>
<attribute name="action">win.shape</attribute>
<attribute name="target">oval</attribute>
<attribute name="accel">&lt;Primary&gt;o</attribute>
<attribute name="accel">&lt;Control&gt;o</attribute>
</item>
</section>
</submenu>
<item>
<attribute name="label" translatable="yes">_Bold</attribute>
<attribute name="action">win.bold</attribute>
<attribute name="accel">&lt;Primary&gt;&lt;Shift&gt;b</attribute>
<attribute name="accel">&lt;Control&gt;&lt;Shift&gt;b</attribute>
</item>
</section>
</submenu>
@ -96,7 +96,7 @@
<item>
<attribute name="label" translatable="yes">_About</attribute>
<attribute name="action">win.about</attribute>
<attribute name="accel">&lt;Primary&gt;a</attribute>
<attribute name="accel">&lt;Control&gt;a</attribute>
</item>
</submenu>
</menu>

View File

@ -13,13 +13,13 @@
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="accelerator">&lt;Primary&gt;q</property>
<property name="accelerator">&lt;Control&gt;q</property>
<property name="title">Quit</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="accelerator">&lt;Primary&gt;d</property>
<property name="accelerator">&lt;Control&gt;d</property>
<property name="title">Switch to dark theme</property>
</object>
</child>
@ -31,7 +31,7 @@
<property name="view">page2</property>
<child>
<object class="GtkShortcutsShortcut">
<property name="accelerator">&lt;Primary&gt;s</property>
<property name="accelerator">&lt;Control&gt;s</property>
<property name="title">Search</property>
</object>
</child>
@ -43,7 +43,7 @@
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="accelerator">&lt;Primary&gt;b</property>
<property name="accelerator">&lt;Control&gt;b</property>
<property name="title">Set background</property>
</object>
</child>
@ -55,19 +55,19 @@
<property name="view">page3</property>
<child>
<object class="GtkShortcutsShortcut">
<property name="accelerator">&lt;Primary&gt;o</property>
<property name="accelerator">&lt;Control&gt;o</property>
<property name="title">Open a file</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="accelerator">&lt;Primary&gt;r</property>
<property name="accelerator">&lt;Control&gt;r</property>
<property name="title">Start recording</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="accelerator">&lt;Primary&gt;l</property>
<property name="accelerator">&lt;Control&gt;l</property>
<property name="title">Lock or unlock</property>
</object>
</child>

View File

@ -1738,18 +1738,18 @@ activate (GApplication *app)
const gchar *accelerators[2];
} accels[] = {
{ "app.about", { "F1", NULL } },
{ "app.quit", { "<Primary>q", NULL } },
{ "app.open-in", { "<Primary>n", NULL } },
{ "app.cut", { "<Primary>x", NULL } },
{ "app.copy", { "<Primary>c", NULL } },
{ "app.paste", { "<Primary>v", NULL } },
{ "win.dark", { "<Primary>d", NULL } },
{ "win.search", { "<Primary>s", NULL } },
{ "app.quit", { "<Control>q", NULL } },
{ "app.open-in", { "<Control>n", NULL } },
{ "app.cut", { "<Control>x", NULL } },
{ "app.copy", { "<Control>c", NULL } },
{ "app.paste", { "<Control>v", NULL } },
{ "win.dark", { "<Control>d", NULL } },
{ "win.search", { "<Control>s", NULL } },
{ "win.delete", { "Delete", NULL } },
{ "win.background", { "<Primary>b", NULL } },
{ "win.open", { "<Primary>o", NULL } },
{ "win.record", { "<Primary>r", NULL } },
{ "win.lock", { "<Primary>l", NULL } },
{ "win.background", { "<Control>b", NULL } },
{ "win.open", { "<Control>o", NULL } },
{ "win.record", { "<Control>r", NULL } },
{ "win.lock", { "<Control>l", NULL } },
};
gint i;
GPermission *permission;

View File

@ -517,13 +517,13 @@ bloat_pad_startup (GApplication *application)
const gchar *action_and_target;
const gchar *accelerators[2];
} accels[] = {
{ "app.new", { "<Primary>n", NULL } },
{ "app.quit", { "<Primary>q", NULL } },
{ "win.copy", { "<Primary>c", NULL } },
{ "win.paste", { "<Primary>p", NULL } },
{ "win.justify::left", { "<Primary>l", NULL } },
{ "win.justify::center", { "<Primary>m", NULL } },
{ "win.justify::right", { "<Primary>r", NULL } }
{ "app.new", { "<Control>n", NULL } },
{ "app.quit", { "<Control>q", NULL } },
{ "win.copy", { "<Control>c", NULL } },
{ "win.paste", { "<Control>p", NULL } },
{ "win.justify::left", { "<Control>l", NULL } },
{ "win.justify::center", { "<Control>m", NULL } },
{ "win.justify::right", { "<Control>r", NULL } }
};
G_APPLICATION_CLASS (bloat_pad_parent_class)
@ -592,7 +592,7 @@ bloat_pad_startup (GApplication *application)
g_object_unref (item);
g_object_unref (icon);
const gchar *new_accels[] = { "<Primary>n", "<Primary>t", NULL };
const gchar *new_accels[] = { "<Control>n", "<Control>t", NULL };
gtk_application_set_accels_for_action (GTK_APPLICATION (application), "app.new", new_accels);
dump_accels (GTK_APPLICATION (application));

View File

@ -124,10 +124,10 @@ gtk_application_impl_quartz_startup (GtkApplicationImpl *impl,
GtkApplicationImplQuartz *quartz = (GtkApplicationImplQuartz *) impl;
GSimpleActionGroup *gtkinternal;
GMenuModel *app_menu;
const gchar *pref_accel[] = {"<Primary>comma", NULL};
const gchar *hide_others_accel[] = {"<Primary><Alt>h", NULL};
const gchar *hide_accel[] = {"<Primary>h", NULL};
const gchar *quit_accel[] = {"<Primary>q", NULL};
const gchar *pref_accel[] = {"<Control>comma", NULL};
const gchar *hide_others_accel[] = {"<Control><Alt>h", NULL};
const gchar *hide_accel[] = {"<Control>h", NULL};
const gchar *quit_accel[] = {"<Control>q", NULL};
if (register_session)
{

View File

@ -278,7 +278,7 @@ gtk_application_load_resources (GtkApplication *application)
path = g_strconcat (base_path, "/gtk/help-overlay.ui", NULL);
if (g_resources_get_info (path, G_RESOURCE_LOOKUP_FLAGS_NONE, NULL, NULL, NULL))
{
const gchar * const accels[] = { "<Primary>question", NULL };
const gchar * const accels[] = { "<Control>question", NULL };
priv->help_overlay_path = path;
gtk_application_set_accels_for_action (application, "win.show-help-overlay", accels);