[gnome-chess/arnaudb/wip/gtk4: 16/27] Adapt UI files.
- From: Arnaud B. <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-chess/arnaudb/wip/gtk4: 16/27] Adapt UI files.
- Date: Sat, 26 Sep 2020 10:09:58 +0000 (UTC)
commit c768ba5728ee8ab0f43d9082e0845f94639a8739
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Tue Apr 7 11:58:20 2020 +0200
Adapt UI files.
data/gnome-chess.ui | 220 +++--------
data/help-overlay.ui | 20 +-
data/preferences.ui | 782 +++++++++++++++++++---------------------
data/promotion-type-selector.ui | 271 +++++---------
src/gnome-chess.vala | 39 +-
5 files changed, 510 insertions(+), 822 deletions(-)
---
diff --git a/data/gnome-chess.ui b/data/gnome-chess.ui
index b1194fc..1cd740a 100644
--- a/data/gnome-chess.ui
+++ b/data/gnome-chess.ui
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
- <!-- interface-requires gtk+ 3.10 -->
+ <requires lib="gtk+" version="3.99"/>
<menu id="app-menu">
<section>
<item>
@@ -48,18 +48,14 @@
</columns>
</object>
<object class="GtkApplicationWindow" id="gnome_chess_app">
- <property name="can-focus">False</property>
<property name="default-width">700</property>
- <signal name="delete-event" handler="gnome_chess_app_delete_event_cb" swapped="no"/>
+<!-- <signal name="delete-event" handler="gnome_chess_app_delete_event_cb" swapped="no"/>-->
<child type="titlebar">
<object class="GtkHeaderBar" id="headerbar">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="show-close-button">True</property>
+ <property name="show-title-buttons">True</property>
<property name="title" translatable="yes">Chess</property>
- <child>
+ <child type="start">
<object class="GtkButton" id="new-game-button">
- <property name="visible">True</property>
<property name="halign">center</property>
<property name="valign">center</property>
<property name="label" translatable="yes">_New Game</property>
@@ -70,28 +66,19 @@
</style>
</object>
</child>
- <child>
+ <child type="start">
<object class="GtkButton" id="undo-move-button">
- <property name="visible">True</property>
<property name="valign">center</property>
<property name="action-name">win.undo</property>
<property name="tooltip-text" translatable="yes">Undo your most recent move</property>
+ <property name="icon-name">edit-undo-symbolic</property>
<style>
<class name="image-button"/>
</style>
- <child>
- <object class="GtkImage">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="icon-size">1</property>
- <property name="icon-name">edit-undo-symbolic</property>
- </object>
- </child>
</object>
</child>
- <child>
+ <child type="start">
<object class="GtkButton" id="pause_button">
- <property name="visible">True</property>
<property name="valign">center</property>
<property name="action-name">win.pause-resume</property>
<style>
@@ -99,37 +86,23 @@
</style>
<child>
<object class="GtkImage">
- <property name="visible">True</property>
<property name="icon-size">1</property>
</object>
</child>
</object>
</child>
- <child>
+ <child type="end">
<object class="GtkMenuButton">
- <property name="visible">True</property>
<property name="can-focus">True</property>
<property name="menu-model">app-menu</property>
<accelerator key="F10" signal="activate"/>
- <child>
- <object class="GtkImage">
- <property name="visible">True</property>
- <property name="icon-name">open-menu-symbolic</property>
- <property name="icon-size">1</property>
- </object>
- </child>
+ <property name="icon-name">open-menu-symbolic</property>
</object>
- <packing>
- <property name="pack-type">end</property>
- <property name="position">1</property>
- </packing>
</child>
</object>
</child>
<child>
<object class="GtkBox">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkInfoBar" id="info_bar">
@@ -137,28 +110,20 @@
</object>
</child>
<child>
- <object class="GtkBox">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
+ <object class="GtkBox" id="view_container">
<property name="orientation">vertical</property>
<property name="spacing">3</property>
<child>
<object class="GtkBox" id="navigation_box">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
<property name="spacing">6</property>
- <property name="margin-left">6</property>
- <property name="margin-right">6</property>
+ <property name="margin-start">6</property>
+ <property name="margin-end">6</property>
<property name="margin-bottom">6</property>
<child>
<object class="GtkBox">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
<property name="spacing">6</property>
<child>
<object class="GtkBox">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
<property name="homogeneous">True</property>
<style>
<class name="raised"/>
@@ -166,123 +131,61 @@
</style>
<child>
<object class="GtkButton" id="first_move_button">
- <property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can-focus">True</property>
- <property name="receives-default">False</property>
<property name="tooltip-text" translatable="yes" comments="Tooltip on the show
first move (i.e. game start) navigation button">Rewind to the game start</property>
- <accelerator key="Left" signal="activate" modifiers="GDK_SHIFT_MASK |
GDK_MOD1_MASK"/>
+ <property name="icon-name">go-first-symbolic</property>
+<!-- <accelerator key="Left" signal="activate" modifiers="GDK_SHIFT_MASK |
GDK_MOD1_MASK"/>-->
<signal name="clicked" handler="history_start_clicked_cb" swapped="no"/>
<style>
<class name="image-button"/>
</style>
- <child>
- <object class="GtkImage">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="icon-size">1</property>
- <property name="icon-name">go-first-symbolic</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
+ </object>>
</child>
<child>
<object class="GtkButton" id="prev_move_button">
- <property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can-focus">True</property>
- <property name="receives-default">False</property>
<property name="tooltip-text" translatable="yes" comments="Tooltip on the show
previous move navigation button">Show the previous move</property>
- <accelerator key="Left" signal="activate" modifiers="GDK_MOD1_MASK"/>
+ <property name="icon-name">go-previous-symbolic</property>
+<!-- <accelerator key="Left" signal="activate" modifiers="GDK_MOD1_MASK"/>-->
<signal name="clicked" handler="history_previous_clicked_cb" swapped="no"/>
<style>
<class name="image-button"/>
</style>
- <child>
- <object class="GtkImage">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="icon-size">1</property>
- <property name="icon-name">go-previous-symbolic</property>
- </object>
- </child>
</object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
</child>
<child>
<object class="GtkButton" id="next_move_button">
- <property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can-focus">True</property>
- <property name="receives-default">False</property>
<property name="tooltip-text" translatable="yes" comments="Tooltip on the show
next move navigation button">Show the next move</property>
- <accelerator key="Right" signal="activate" modifiers="GDK_MOD1_MASK"/>
+ <property name="icon-name">go-next-symbolic</property>
+<!-- <accelerator key="Right" signal="activate" modifiers="GDK_MOD1_MASK"/>-->
<signal name="clicked" handler="history_next_clicked_cb" swapped="no"/>
<style>
<class name="image-button"/>
</style>
- <child>
- <object class="GtkImage">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="icon-size">1</property>
- <property name="icon-name">go-next-symbolic</property>
- </object>
- </child>
</object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">2</property>
- </packing>
</child>
<child>
<object class="GtkButton" id="last_move_button">
- <property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can-focus">True</property>
- <property name="receives-default">False</property>
<property name="tooltip-text" translatable="yes" comments="Tooltip on the show
current move navigation button">Show the current move</property>
- <accelerator key="Right" signal="activate" modifiers="GDK_SHIFT_MASK |
GDK_MOD1_MASK"/>
+ <property name="icon-name">go-last-symbolic</property>
+<!-- <accelerator key="Right" signal="activate" modifiers="GDK_SHIFT_MASK |
GDK_MOD1_MASK"/>-->
<signal name="clicked" handler="history_latest_clicked_cb" swapped="no"/>
<style>
<class name="image-button"/>
</style>
- <child>
- <object class="GtkImage">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="icon-size">1</property>
- <property name="icon-name">go-last-symbolic</property>
- </object>
- </child>
</object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">3</property>
- </packing>
</child>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
</child>
<child>
<object class="GtkComboBox" id="history_combo">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
+ <property name="hexpand">True</property>
<property name="model">history-model</property>
<signal name="changed" handler="history_combo_changed_cb" swapped="no"/>
<child>
@@ -294,89 +197,54 @@
</attributes>
</child>
</object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
</child>
</object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
</child>
<child>
<object class="GtkBox">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
<property name="spacing">6</property>
<property name="homogeneous">True</property>
<child>
<object class="GtkDrawingArea" id="white_time_label">
<!-- -1 means compute at runtime -->
<property name="width-request">-1</property>
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <signal name="draw" handler="white_time_draw_cb" swapped="no"/>
</object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
+<!-- <packing>-->
+<!-- <property name="expand">True</property>-->
+<!-- <property name="fill">True</property>-->
+<!-- </packing>-->
</child>
<child>
<object class="GtkDrawingArea" id="black_time_label">
<!-- -1 means compute at runtime -->
<property name="width-request">-1</property>
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <signal name="draw" handler="black_time_draw_cb" swapped="no"/>
</object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
+<!-- <packing>-->
+<!-- <property name="expand">True</property>-->
+<!-- <property name="fill">True</property>-->
+<!-- </packing>-->
</child>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">2</property>
- </packing>
+<!-- <packing>-->
+<!-- <property name="expand">False</property>-->
+<!-- <property name="fill">True</property>-->
+<!-- </packing>-->
</child>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack-type">end</property>
- <property name="position">0</property>
- </packing>
+<!-- <packing>-->
+<!-- <property name="expand">False</property>-->
+<!-- <property name="fill">True</property>-->
+<!-- <property name="pack-type">end</property>-->
+<!-- </packing>-->
</child>
<child>
- <object class="GtkAlignment" id="view_container">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <child>
- <placeholder/>
- </child>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="pack-type">end</property>
- <property name="position">1</property>
- </packing>
+ <placeholder/>
</child>
+<!-- <packing>-->
+<!-- <property name="expand">True</property>-->
+<!-- <property name="fill">True</property>-->
+<!-- </packing>-->
</object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">2</property>
- </packing>
</child>
</object>
</child>
diff --git a/data/help-overlay.ui b/data/help-overlay.ui
index 51a088e..b380ab6 100644
--- a/data/help-overlay.ui
+++ b/data/help-overlay.ui
@@ -1,68 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
- <!-- interface-requires gtk+ 3.17 -->
+ <requires lib="gtk+" version="3.99"/>
<object class="GtkShortcutsWindow" id="help_overlay">
<property name="modal">1</property>
<child>
<object class="GtkShortcutsSection">
- <property name="visible">1</property>
<property name="max-height">8</property>
<child>
<object class="GtkShortcutsGroup">
<property name="title" translatable="yes" context="shortcut window">General</property>
- <property name="visible">1</property>
<child>
<object class="GtkShortcutsShortcut">
- <property name="visible">1</property>
<property name="accelerator"><Ctrl>N</property>
<property name="title" translatable="yes" context="shortcut window">Start a new
game</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
- <property name="visible">1</property>
<property name="accelerator"><Ctrl>O</property>
<property name="title" translatable="yes" context="shortcut window">Open a saved
game</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
- <property name="visible">1</property>
<property name="accelerator"><Ctrl>P Pause</property>
<property name="title" translatable="yes" context="shortcut window">Pause the game</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
- <property name="visible">1</property>
<property name="accelerator"><Ctrl>S</property>
<property name="title" translatable="yes" context="shortcut window">Save the game</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
- <property name="visible">1</property>
<property name="accelerator"><Shift><Ctrl>S</property>
<property name="title" translatable="yes" context="shortcut window">Save the game with a
different name</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
- <property name="visible">1</property>
<property name="accelerator"><Ctrl>Z</property>
<property name="title" translatable="yes" context="shortcut window">Undo move</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
- <property name="visible">1</property>
<property name="accelerator"><Ctrl>Q</property>
<property name="title" translatable="yes" context="shortcut window">Quit</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
- <property name="visible">1</property>
<property name="accelerator">F10</property>
<property name="title" translatable="yes" context="shortcut window">Open menu</property>
</object>
@@ -72,31 +62,26 @@
<child>
<object class="GtkShortcutsGroup">
<property name="title" translatable="yes" context="shortcut window">History</property>
- <property name="visible">1</property>
<child>
<object class="GtkShortcutsShortcut">
- <property name="visible">1</property>
<property name="accelerator"><Shift><Alt>Left</property>
<property name="title" translatable="yes" context="shortcut window">Rewind to the game
start</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
- <property name="visible">1</property>
<property name="accelerator"><Alt>Left</property>
<property name="title" translatable="yes" context="shortcut window">Show the previous
move</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
- <property name="visible">1</property>
<property name="accelerator"><Alt>Right</property>
<property name="title" translatable="yes" context="shortcut window">Show the next
move</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
- <property name="visible">1</property>
<property name="accelerator"><Shift><Alt>Right</property>
<property name="title" translatable="yes" context="shortcut window">Show the current
move</property>
</object>
@@ -106,17 +91,14 @@
<child>
<object class="GtkShortcutsGroup">
<property name="title" translatable="yes" context="shortcut window">Help</property>
- <property name="visible">1</property>
<child>
<object class="GtkShortcutsShortcut">
- <property name="visible">1</property>
<property name="accelerator">F1</property>
<property name="title" translatable="yes" context="shortcut window">Show Help</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
- <property name="visible">1</property>
<property name="accelerator"><Primary>question</property>
<property name="title" translatable="yes" context="shortcut window">Show Keyboard
Shortcuts</property>
</object>
diff --git a/data/preferences.ui b/data/preferences.ui
index 80f89da..824ec1c 100644
--- a/data/preferences.ui
+++ b/data/preferences.ui
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
- <!-- interface-requires gtk+ 3.12 -->
+ <requires lib="gtk+" version="3.99"/>
<object class="GtkListStore" id="custom-duration-units-model">
<columns>
<!-- column-name label -->
@@ -226,508 +226,452 @@
<property name="title" translatable="yes" comments="Title for preferences dialog">Preferences</property>
<property name="resizable">False</property>
<property name="destroy-with-parent">True</property>
- <property name="type-hint">dialog</property>
<property name="use-header-bar">1</property>
- <signal name="delete-event" handler="preferences_delete_event_cb" swapped="no"/>
+<!-- <signal name="delete-event" handler="preferences_delete_event_cb" swapped="no"/>-->
<signal name="response" handler="preferences_response_cb" swapped="no"/>
- <child internal-child="vbox">
+ <child internal-child="content_area">
<object class="GtkBox">
- <property name="visible">True</property>
<property name="can-focus">False</property>
+ <property name="margin-start">5</property>
+ <property name="margin-end">5</property>
+ <property name="margin-top">5</property>
+ <property name="margin-bottom">5</property>
<child>
<object class="GtkNotebook">
- <property name="visible">True</property>
<property name="can-focus">True</property>
- <property name="border-width">5</property>
<child>
- <object class="GtkGrid">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="border-width">10</property>
- <property name="column-spacing">5</property>
- <property name="row-spacing">5</property>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes" comments="Preferences Dialog: Label before
clock type (Fischer/Bronstein) combo box">_Clock type:</property>
- <property name="use-underline">True</property>
- <property name="mnemonic-widget">clock_type_combo</property>
- </object>
- <packing>
- <property name="top-attach">5</property>
- <property name="left-attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="timer_increment_label">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes" comments="Preferences Dialog: Label before
timer increment combo box">Timer _increment:</property>
- <property name="use-underline">True</property>
- <property name="mnemonic-widget">timer-increment-spin</property>
- </object>
- <packing>
- <property name="top-attach">6</property>
- <property name="left-attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBox" id="clock_type_combo">
- <property name="visible">True</property>
- <property name="hexpand">True</property>
+ <object class="GtkNotebookPage">
+ <property name="tab-fill">False</property>
+ <property name="child">
+ <object class="GtkGrid">
<property name="can-focus">False</property>
- <property name="model">clock-type-model</property>
- <signal name="changed" handler="clock_type_changed_cb" swapped="no"/>
+ <property name="margin-start">10</property>
+ <property name="margin-end">10</property>
+ <property name="margin-top">10</property>
+ <property name="margin-bottom">10</property>
+ <property name="column-spacing">5</property>
+ <property name="row-spacing">5</property>
<child>
- <object class="GtkCellRendererText"/>
- <attributes>
- <attribute name="text">0</attribute>
- </attributes>
+ <object class="GtkLabel">
+ <property name="can-focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes" comments="Preferences Dialog: Label before
clock type (Fischer/Bronstein) combo box">_Clock type:</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">clock_type_combo</property>
+ <layout>
+ <property name="top-attach">5</property>
+ <property name="left-attach">0</property>
+ </layout>
+ </object>
</child>
- </object>
- <packing>
- <property name="top-attach">5</property>
- <property name="left-attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes" comments="Preferences Dialog: Label before
player side (white/black) combo box">_Play as:</property>
- <property name="use-underline">True</property>
- <property name="mnemonic-widget">side_combo</property>
- </object>
- <packing>
- <property name="top-attach">1</property>
- <property name="left-attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes" comments="Preferences Dialog: Label before
opposing player combo box">_Opposing player:</property>
- <property name="use-underline">True</property>
- <property name="mnemonic-widget">opponent_combo</property>
- </object>
- <packing>
- <property name="top-attach">0</property>
- <property name="left-attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes" comments="Preferences Dialog: Label before
difficulty level combo box">_Difficulty:</property>
- <property name="use-underline">True</property>
- <property name="mnemonic-widget">difficulty_combo</property>
- </object>
- <packing>
- <property name="top-attach">2</property>
- <property name="left-attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkBox" id="timer_increment_box">
- <property name="visible">True</property>
- <property name="hexpand">True</property>
- <property name="can-focus">False</property>
- <property name="spacing">6</property>
<child>
- <object class="GtkSpinButton" id="timer-increment-spin">
- <property name="visible">True</property>
- <property name="can-focus">True</property>
- <property name="invisible-char">•</property>
- <property name="adjustment">timer_increment_adjustment</property>
- <property name="climb-rate">1</property>
- <property name="numeric">True</property>
+ <object class="GtkLabel" id="timer_increment_label">
+ <property name="can-focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes" comments="Preferences Dialog: Label before
timer increment combo box">Timer _increment:</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">timer-increment-spin</property>
+ <layout>
+ <property name="top-attach">6</property>
+ <property name="left-attach">0</property>
+ </layout>
</object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
</child>
<child>
- <object class="GtkComboBox" id="timer_increment_units_combo">
- <property name="visible">True</property>
+ <object class="GtkComboBox" id="clock_type_combo">
+ <property name="hexpand">True</property>
<property name="can-focus">False</property>
- <property name="model">timer-increment-units-model</property>
- <signal name="changed" handler="timer_increment_units_changed_cb" swapped="no"/>
+ <property name="model">clock-type-model</property>
+ <signal name="changed" handler="clock_type_changed_cb" swapped="no"/>
<child>
<object class="GtkCellRendererText"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
+ <layout>
+ <property name="top-attach">5</property>
+ <property name="left-attach">1</property>
+ </layout>
</object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
</child>
- </object>
- <packing>
- <property name="top-attach">6</property>
- <property name="left-attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBox" id="side_combo">
- <property name="visible">True</property>
- <property name="hexpand">True</property>
- <property name="can-focus">False</property>
- <property name="model">side-model</property>
- <signal name="changed" handler="side_combo_changed_cb" swapped="no"/>
<child>
- <object class="GtkCellRendererText"/>
- <attributes>
- <attribute name="text">0</attribute>
- </attributes>
+ <object class="GtkLabel">
+ <property name="can-focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes" comments="Preferences Dialog: Label before
player side (white/black) combo box">_Play as:</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">side_combo</property>
+ <layout>
+ <property name="top-attach">1</property>
+ <property name="left-attach">0</property>
+ </layout>
+ </object>
</child>
- </object>
- <packing>
- <property name="top-attach">1</property>
- <property name="left-attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBox" id="opponent_combo">
- <property name="visible">True</property>
- <property name="hexpand">True</property>
- <property name="can-focus">False</property>
- <property name="model">opponent-model</property>
- <signal name="changed" handler="opponent_combo_changed_cb" swapped="no"/>
<child>
- <object class="GtkCellRendererText"/>
- <attributes>
- <attribute name="text">0</attribute>
- </attributes>
+ <object class="GtkLabel">
+ <property name="can-focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes" comments="Preferences Dialog: Label before
opposing player combo box">_Opposing player:</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">opponent_combo</property>
+ <layout>
+ <property name="top-attach">0</property>
+ <property name="left-attach">0</property>
+ </layout>
+ </object>
</child>
- </object>
- <packing>
- <property name="top-attach">0</property>
- <property name="left-attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBox" id="difficulty_combo">
- <property name="visible">True</property>
- <property name="hexpand">True</property>
- <property name="can-focus">False</property>
- <property name="model">difficulty-model</property>
- <signal name="changed" handler="difficulty_combo_changed_cb" swapped="no"/>
<child>
- <object class="GtkCellRendererText"/>
- <attributes>
- <attribute name="text">0</attribute>
- </attributes>
+ <object class="GtkLabel">
+ <property name="can-focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes" comments="Preferences Dialog: Label before
difficulty level combo box">_Difficulty:</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">difficulty_combo</property>
+ <layout>
+ <property name="top-attach">2</property>
+ <property name="left-attach">0</property>
+ </layout>
+ </object>
</child>
- </object>
- <packing>
- <property name="top-attach">2</property>
- <property name="left-attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkBox" id="custom_duration_box">
- <property name="visible">True</property>
- <property name="hexpand">True</property>
- <property name="can-focus">False</property>
- <property name="spacing">6</property>
<child>
- <object class="GtkSpinButton">
- <property name="visible">True</property>
- <property name="can-focus">True</property>
- <property name="invisible-char">•</property>
- <property name="adjustment">duration_adjustment</property>
- <property name="climb-rate">1</property>
- <property name="numeric">True</property>
+ <object class="GtkBox" id="timer_increment_box">
+ <property name="hexpand">True</property>
+ <property name="can-focus">False</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkSpinButton" id="timer-increment-spin">
+ <property name="hexpand">True</property>
+ <property name="can-focus">True</property>
+<!-- <property name="invisible-char">•</property>-->
+ <property name="adjustment">timer_increment_adjustment</property>
+ <property name="climb-rate">1</property>
+ <property name="numeric">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="timer_increment_units_combo">
+ <property name="hexpand">True</property>
+ <property name="can-focus">False</property>
+ <property name="model">timer-increment-units-model</property>
+ <signal name="changed" handler="timer_increment_units_changed_cb" swapped="no"/>
+ <child>
+ <object class="GtkCellRendererText"/>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
+ <layout>
+ <property name="top-attach">6</property>
+ <property name="left-attach">1</property>
+ </layout>
</object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
</child>
<child>
- <object class="GtkComboBox" id="custom_duration_units_combo">
- <property name="visible">True</property>
+ <object class="GtkComboBox" id="side_combo">
+ <property name="hexpand">True</property>
<property name="can-focus">False</property>
- <property name="model">custom-duration-units-model</property>
- <signal name="changed" handler="duration_units_changed_cb" swapped="no"/>
+ <property name="model">side-model</property>
+ <signal name="changed" handler="side_combo_changed_cb" swapped="no"/>
<child>
<object class="GtkCellRendererText"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
+ <layout>
+ <property name="top-attach">1</property>
+ <property name="left-attach">1</property>
+ </layout>
</object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
</child>
- </object>
- <packing>
- <property name="top-attach">4</property>
- <property name="left-attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes" comments="Preferences Dialog: Label before
game timer settings">_Time limit:</property>
- <property name="use-underline">True</property>
- <property name="mnemonic-widget">duration_combo</property>
- </object>
- <packing>
- <property name="top-attach">3</property>
- <property name="left-attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBox" id="duration_combo">
- <property name="visible">True</property>
- <property name="hexpand">True</property>
- <property name="can-focus">False</property>
- <property name="model">duration-model</property>
- <signal name="changed" handler="duration_combo_changed_cb" swapped="no"/>
<child>
- <object class="GtkCellRendererText"/>
- <attributes>
- <attribute name="text">0</attribute>
- </attributes>
+ <object class="GtkComboBox" id="opponent_combo">
+ <property name="hexpand">True</property>
+ <property name="can-focus">False</property>
+ <property name="model">opponent-model</property>
+ <signal name="changed" handler="opponent_combo_changed_cb" swapped="no"/>
+ <child>
+ <object class="GtkCellRendererText"/>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
+ </child>
+ <layout>
+ <property name="top-attach">0</property>
+ <property name="left-attach">1</property>
+ </layout>
+ </object>
</child>
- </object>
- <packing>
- <property name="top-attach">3</property>
- <property name="left-attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkBox">
- <property name="visible">True</property>
- <property name="hexpand">True</property>
- <property name="can-focus">False</property>
- <property name="spacing">5</property>
<child>
- <object class="GtkImage">
- <property name="visible">True</property>
+ <object class="GtkComboBox" id="difficulty_combo">
+ <property name="hexpand">True</property>
<property name="can-focus">False</property>
- <property name="icon-name">dialog-information-symbolic</property>
- <property name="icon-size">6</property>
+ <property name="model">difficulty-model</property>
+ <signal name="changed" handler="difficulty_combo_changed_cb" swapped="no"/>
+ <child>
+ <object class="GtkCellRendererText"/>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
+ </child>
+ <layout>
+ <property name="top-attach">2</property>
+ <property name="left-attach">1</property>
+ </layout>
+ </object>
+ </child>
+ <child>
+ <object class="GtkBox" id="custom_duration_box">
+ <property name="hexpand">True</property>
+ <property name="can-focus">False</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkSpinButton">
+ <property name="hexpand">True</property>
+ <property name="can-focus">True</property>
+<!-- <property name="invisible-char">•</property>-->
+ <property name="adjustment">duration_adjustment</property>
+ <property name="climb-rate">1</property>
+ <property name="numeric">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="custom_duration_units_combo">
+ <property name="hexpand">True</property>
+ <property name="can-focus">False</property>
+ <property name="model">custom-duration-units-model</property>
+ <signal name="changed" handler="duration_units_changed_cb" swapped="no"/>
+ <child>
+ <object class="GtkCellRendererText"/>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
+ <layout>
+ <property name="top-attach">4</property>
+ <property name="left-attach">1</property>
+ </layout>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
</child>
<child>
<object class="GtkLabel">
- <property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
- <property name="label" translatable="yes" comments="Preferences dialog: Label to
notify user that the settings are applied for the next game">Changes will take effect for the next
game.</property>
+ <property name="label" translatable="yes" comments="Preferences Dialog: Label before
game timer settings">_Time limit:</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">duration_combo</property>
+ <layout>
+ <property name="top-attach">3</property>
+ <property name="left-attach">0</property>
+ </layout>
+ </object>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="duration_combo">
+ <property name="hexpand">True</property>
+ <property name="can-focus">False</property>
+ <property name="model">duration-model</property>
+ <signal name="changed" handler="duration_combo_changed_cb" swapped="no"/>
+ <child>
+ <object class="GtkCellRendererText"/>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
+ </child>
+ <layout>
+ <property name="top-attach">3</property>
+ <property name="left-attach">1</property>
+ </layout>
+ </object>
+ </child>
+ <child>
+ <object class="GtkBox">
+ <property name="hexpand">True</property>
+ <property name="can-focus">False</property>
+ <property name="spacing">5</property>
+ <child>
+ <object class="GtkImage">
+ <property name="can-focus">False</property>
+ <property name="icon-name">dialog-information-symbolic</property>
+ <property name="icon-size">large</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="hexpand">True</property>
+ <property name="can-focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes" comments="Preferences dialog: Label to
notify user that the settings are applied for the next game">Changes will take effect for the next
game.</property>
+ </object>
+ </child>
+ <layout>
+ <property name="top-attach">7</property>
+ <property name="left-attach">0</property>
+ <property name="column-span">2</property>
+ </layout>
</object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
</child>
</object>
- <packing>
- <property name="top-attach">7</property>
- <property name="left-attach">0</property>
- <property name="width">2</property>
- </packing>
- </child>
+ </property>
</object>
</child>
<child type="tab">
<object class="GtkLabel">
- <property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes" comments="Preferences Dialog: Tab title for game
preferences">_Game</property>
<property name="use-underline">True</property>
</object>
- <packing>
- <property name="tab-fill">False</property>
- </packing>
</child>
<child>
- <object class="GtkGrid">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="border-width">10</property>
- <property name="column-spacing">5</property>
- <property name="row-spacing">5</property>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes" comments="Preferences Dialog: Label before
board orientation combo box">Board _orientation:</property>
- <property name="use-underline">True</property>
- <property name="mnemonic-widget">orientation_combo</property>
- </object>
- <packing>
- <property name="left-attach">0</property>
- <property name="top-attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes" comments="Preferences Dialog: Label before
move format combo box">Move _format:</property>
- <property name="use-underline">True</property>
- <property name="mnemonic-widget">move_format_combo</property>
- </object>
- <packing>
- <property name="left-attach">0</property>
- <property name="top-attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes" comments="Preferences Dialog: Label before
piece style combo box">_Piece style:</property>
- <property name="use-underline">True</property>
- <property name="mnemonic-widget">piece_style_combo</property>
- </object>
- <packing>
- <property name="left-attach">0</property>
- <property name="top-attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBox" id="orientation_combo">
- <property name="visible">True</property>
- <property name="hexpand">True</property>
+ <object class="GtkNotebookPage">
+ <property name="tab-fill">False</property>
+ <property name="child">
+ <object class="GtkGrid">
<property name="can-focus">False</property>
- <property name="model">orientation-model</property>
- <signal name="changed" handler="orientation_combo_changed_cb" swapped="no"/>
+ <property name="margin-start">10</property>
+ <property name="margin-end">10</property>
+ <property name="margin-top">10</property>
+ <property name="margin-bottom">10</property>
+ <property name="column-spacing">5</property>
+ <property name="row-spacing">5</property>
<child>
- <object class="GtkCellRendererText"/>
- <attributes>
- <attribute name="text">0</attribute>
- </attributes>
+ <object class="GtkLabel">
+ <property name="can-focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes" comments="Preferences Dialog: Label before
board orientation combo box">Board _orientation:</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">orientation_combo</property>
+ <layout>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
+ </layout>
+ </object>
</child>
- </object>
- <packing>
- <property name="left-attach">1</property>
- <property name="top-attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBox" id="move_format_combo">
- <property name="visible">True</property>
- <property name="hexpand">True</property>
- <property name="can-focus">False</property>
- <property name="model">move-format-model</property>
- <signal name="changed" handler="move_format_combo_changed_cb" swapped="no"/>
<child>
- <object class="GtkCellRendererText"/>
- <attributes>
- <attribute name="text">0</attribute>
- </attributes>
+ <object class="GtkLabel">
+ <property name="can-focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes" comments="Preferences Dialog: Label before
move format combo box">Move _format:</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">move_format_combo</property>
+ <layout>
+ <property name="left-attach">0</property>
+ <property name="top-attach">1</property>
+ </layout>
+ </object>
</child>
- </object>
- <packing>
- <property name="left-attach">1</property>
- <property name="top-attach">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBox" id="piece_style_combo">
- <property name="visible">True</property>
- <property name="hexpand">True</property>
- <property name="can-focus">True</property>
- <property name="model">piece-style-model</property>
- <signal name="changed" handler="piece_style_combo_changed_cb" swapped="no"/>
<child>
- <object class="GtkCellRendererText"/>
- <attributes>
- <attribute name="text">0</attribute>
- </attributes>
+ <object class="GtkLabel">
+ <property name="can-focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes" comments="Preferences Dialog: Label before
piece style combo box">_Piece style:</property>
+ <property name="use-underline">True</property>
+ <property name="mnemonic-widget">piece_style_combo</property>
+ <layout>
+ <property name="left-attach">0</property>
+ <property name="top-attach">2</property>
+ </layout>
+ </object>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="orientation_combo">
+ <property name="hexpand">True</property>
+ <property name="can-focus">False</property>
+ <property name="model">orientation-model</property>
+ <signal name="changed" handler="orientation_combo_changed_cb" swapped="no"/>
+ <child>
+ <object class="GtkCellRendererText"/>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
+ </child>
+ <layout>
+ <property name="left-attach">1</property>
+ <property name="top-attach">0</property>
+ </layout>
+ </object>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="move_format_combo">
+ <property name="hexpand">True</property>
+ <property name="can-focus">False</property>
+ <property name="model">move-format-model</property>
+ <signal name="changed" handler="move_format_combo_changed_cb" swapped="no"/>
+ <child>
+ <object class="GtkCellRendererText"/>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
+ </child>
+ <layout>
+ <property name="left-attach">1</property>
+ <property name="top-attach">1</property>
+ </layout>
+ </object>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="piece_style_combo">
+ <property name="hexpand">True</property>
+ <property name="can-focus">True</property>
+ <property name="model">piece-style-model</property>
+ <signal name="changed" handler="piece_style_combo_changed_cb" swapped="no"/>
+ <child>
+ <object class="GtkCellRendererText"/>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
+ </child>
+ <layout>
+ <property name="left-attach">1</property>
+ <property name="top-attach">2</property>
+ </layout>
+ </object>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="show_numbering_check">
+ <property name="label" translatable="yes" comments="Preferences Dialog: Check box
for selecting if board numbering is visible">_Board numbering</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ <layout>
+ <property name="left-attach">0</property>
+ <property name="top-attach">3</property>
+ <property name="column-span">2</property>
+ </layout>
+ </object>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="show_move_hints_check">
+ <property name="label" translatable="yes" comments="Preferences Dialog: Check box
for selecting if move hints are visible">_Move hints</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="use-underline">True</property>
+ <property name="draw-indicator">True</property>
+ <layout>
+ <property name="left-attach">0</property>
+ <property name="top-attach">4</property>
+ <property name="column-span">2</property>
+ </layout>
+ </object>
</child>
</object>
- <packing>
- <property name="left-attach">1</property>
- <property name="top-attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="show_numbering_check">
- <property name="label" translatable="yes" comments="Preferences Dialog: Check box for
selecting if board numbering is visible">_Board numbering</property>
- <property name="visible">True</property>
- <property name="can-focus">True</property>
- <property name="receives-default">False</property>
- <property name="use-underline">True</property>
- <property name="draw-indicator">True</property>
- </object>
- <packing>
- <property name="left-attach">0</property>
- <property name="top-attach">3</property>
- <property name="width">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="show_move_hints_check">
- <property name="label" translatable="yes" comments="Preferences Dialog: Check box for
selecting if move hints are visible">_Move hints</property>
- <property name="visible">True</property>
- <property name="can-focus">True</property>
- <property name="receives-default">False</property>
- <property name="use-underline">True</property>
- <property name="draw-indicator">True</property>
- </object>
- <packing>
- <property name="left-attach">0</property>
- <property name="top-attach">4</property>
- <property name="width">2</property>
- </packing>
- </child>
+ </property>
</object>
- <packing>
- <property name="position">1</property>
- </packing>
</child>
<child type="tab">
<object class="GtkLabel">
- <property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes" comments="Preferences Dialog: Title of appearance
options tab">_Appearance</property>
<property name="use-underline">True</property>
</object>
- <packing>
- <property name="position">1</property>
- <property name="tab-fill">False</property>
- </packing>
</child>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">2</property>
- </packing>
</child>
</object>
</child>
diff --git a/data/promotion-type-selector.ui b/data/promotion-type-selector.ui
index 3d0a196..7e6ca92 100644
--- a/data/promotion-type-selector.ui
+++ b/data/promotion-type-selector.ui
@@ -1,231 +1,124 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
- <!-- interface-requires gtk+ 3.12 -->
+ <requires lib="gtk+" version="3.99"/>
<object class="GtkDialog" id="dialog_promotion_type_selector">
- <property name="can-focus">False</property>
<property name="border-width">5</property>
<property name="title" translatable="yes">Select Promotion Type</property>
<property name="type-hint">dialog</property>
<property name="has-resize-grip">False</property>
<property name="use-header-bar">1</property>
- <child internal-child="vbox">
+ <child internal-child="content_area">
<object class="GtkBox">
<property name="can-focus">False</property>
<property name="margin-left">12</property>
<property name="margin-right">12</property>
<property name="margin-top">6</property>
<property name="margin-bottom">20</property>
- <child internal-child="action_area">
- <object class="GtkButtonBox">
- <property name="can-focus">False</property>
- <property name="layout-style">center</property>
+ </object>
+ </child>
+ <child internal-child="action_area">
+ <object class="GtkButtonBox">
+ <property name="can-focus">False</property>
+ <property name="layout-style">center</property>
+ <child>
+ <object class="GtkToggleButton" id="togglebutton-queen">
+ <property name="width-request">100</property>
+ <property name="height-request">120</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ <property name="use-underline">True</property>
+ <property name="image-position">top</property>
<child>
- <object class="GtkToggleButton" id="togglebutton-queen">
- <property name="width-request">100</property>
- <property name="height-request">120</property>
- <property name="visible">True</property>
- <property name="can-focus">True</property>
- <property name="receives-default">True</property>
- <property name="use-underline">True</property>
- <property name="image-position">top</property>
+ <object class="GtkGrid">
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <child>
+ <object class="GtkImage" id="image_queen"/>
+ </child>
<child>
- <object class="GtkGrid">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="halign">center</property>
- <property name="valign">center</property>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="label" translatable="yes">_Queen</property>
- <property name="use-underline">True</property>
- </object>
- <packing>
- <property name="left-attach">0</property>
- <property name="top-attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkImage" id="image_queen">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- </object>
- <packing>
- <property name="left-attach">0</property>
- <property name="top-attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
+ <object class="GtkLabel">
+ <property name="label" translatable="yes">_Queen</property>
+ <property name="use-underline">True</property>
</object>
</child>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
</child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkToggleButton" id="togglebutton-knight">
+ <property name="width-request">100</property>
+ <property name="height-request">120</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ <property name="use-underline">True</property>
+ <property name="image-position">top</property>
<child>
- <object class="GtkToggleButton" id="togglebutton-knight">
- <property name="width-request">100</property>
- <property name="height-request">120</property>
- <property name="visible">True</property>
- <property name="can-focus">True</property>
- <property name="receives-default">True</property>
- <property name="use-underline">True</property>
- <property name="image-position">top</property>
+ <object class="GtkGrid">
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <child>
+ <object class="GtkImage" id="image_knight"/>
+ </child>
<child>
- <object class="GtkGrid">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="halign">center</property>
- <property name="valign">center</property>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="label" translatable="yes">_Knight</property>
- <property name="use-underline">True</property>
- </object>
- <packing>
- <property name="left-attach">0</property>
- <property name="top-attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkImage" id="image_knight">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- </object>
- <packing>
- <property name="left-attach">0</property>
- <property name="top-attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
+ <object class="GtkLabel">
+ <property name="label" translatable="yes">_Knight</property>
+ <property name="use-underline">True</property>
</object>
</child>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
</child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkToggleButton" id="togglebutton-rook">
+ <property name="width-request">100</property>
+ <property name="height-request">120</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ <property name="use-underline">True</property>
+ <property name="image-position">top</property>
<child>
- <object class="GtkToggleButton" id="togglebutton-rook">
- <property name="width-request">100</property>
- <property name="height-request">120</property>
- <property name="visible">True</property>
- <property name="can-focus">True</property>
- <property name="receives-default">True</property>
- <property name="use-underline">True</property>
- <property name="image-position">top</property>
+ <object class="GtkGrid">
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <child>
+ <object class="GtkImage" id="image_rook"/>
+ </child>
<child>
- <object class="GtkGrid">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="halign">center</property>
- <property name="valign">center</property>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="label" translatable="yes">_Rook</property>
- <property name="use-underline">True</property>
- </object>
- <packing>
- <property name="left-attach">0</property>
- <property name="top-attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkImage" id="image_rook">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- </object>
- <packing>
- <property name="left-attach">0</property>
- <property name="top-attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
+ <object class="GtkLabel">
+ <property name="label" translatable="yes">_Rook</property>
+ <property name="use-underline">True</property>
</object>
</child>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">2</property>
- </packing>
</child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkToggleButton" id="togglebutton-bishop">
+ <property name="width-request">100</property>
+ <property name="height-request">120</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ <property name="use-underline">True</property>
+ <property name="image-position">top</property>
<child>
- <object class="GtkToggleButton" id="togglebutton-bishop">
- <property name="width-request">100</property>
- <property name="height-request">120</property>
- <property name="visible">True</property>
- <property name="can-focus">True</property>
- <property name="receives-default">True</property>
- <property name="use-underline">True</property>
- <property name="image-position">top</property>
+ <object class="GtkGrid">
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <child>
+ <object class="GtkImage" id="image_bishop"/>
+ </child>
<child>
- <object class="GtkGrid">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="halign">center</property>
- <property name="valign">center</property>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="label" translatable="yes">_Bishop</property>
- <property name="use-underline">True</property>
- </object>
- <packing>
- <property name="left-attach">0</property>
- <property name="top-attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkImage" id="image_bishop">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- </object>
- <packing>
- <property name="left-attach">0</property>
- <property name="top-attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
+ <object class="GtkLabel">
+ <property name="label" translatable="yes">_Bishop</property>
+ <property name="use-underline">True</property>
</object>
</child>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">3</property>
- </packing>
</child>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack-type">end</property>
- <property name="position">0</property>
- </packing>
</child>
</object>
</child>
diff --git a/src/gnome-chess.vala b/src/gnome-chess.vala
index 7fd12dd..0547e30 100644
--- a/src/gnome-chess.vala
+++ b/src/gnome-chess.vala
@@ -30,7 +30,7 @@ public class ChessApplication : Gtk.Application
private GLib.Settings settings;
private ApplicationWindow window;
private InfoBar info_bar;
- private Container view_container;
+ private Box view_container;
private ChessScene scene;
private ChessView view;
private Button pause_resume_button;
@@ -40,8 +40,8 @@ public class ChessApplication : Gtk.Application
private Widget next_move_button;
private Widget last_move_button;
private ComboBox history_combo;
- private Widget white_time_label;
- private Widget black_time_label;
+ private DrawingArea white_time_label;
+ private DrawingArea black_time_label;
private Widget timer_increment_label;
private HeaderBar headerbar;
@@ -169,12 +169,15 @@ Copyright © 2015–2016 Sahil Sareen""";
next_move_button = (Widget) builder.get_object ("next_move_button");
last_move_button = (Widget) builder.get_object ("last_move_button");
history_combo = (ComboBox) builder.get_object ("history_combo");
- white_time_label = (Widget) builder.get_object ("white_time_label");
- black_time_label = (Widget) builder.get_object ("black_time_label");
- view_container = (Container) builder.get_object ("view_container");
+ white_time_label = (DrawingArea) builder.get_object ("white_time_label");
+ black_time_label = (DrawingArea) builder.get_object ("black_time_label");
+ view_container = (Box) builder.get_object ("view_container");
headerbar = (HeaderBar) builder.get_object ("headerbar");
// builder.connect_signals (this);
+ white_time_label.set_draw_func (white_time_draw_cb);
+ black_time_label.set_draw_func (black_time_draw_cb);
+
update_pause_resume_button ();
window.add_action_entries (window_entries, this);
@@ -201,7 +204,9 @@ Copyright © 2015–2016 Sahil Sareen""";
view = new ChessView ();
view.set_size_request (100, 100);
view.scene = scene;
- view_container.add (view);
+ view.hexpand = true;
+ view.vexpand = true;
+ view_container.insert_child_after (view, /* insert first */ null);
view.show ();
var system_engine_cfg = Path.build_filename (SYSCONFDIR, "gnome-chess", "engines.conf", null);
@@ -1434,12 +1439,12 @@ Copyright © 2015–2016 Sahil Sareen""";
black_time_label.queue_draw ();
}
- [CCode (cname = "gnome_chess_app_delete_event_cb", instance_pos = -1)]
- public bool gnome_chess_app_delete_event_cb (Widget widget, Gdk.Event event)
- {
- quit_game ();
- return false;
- }
+// [CCode (cname = "gnome_chess_app_delete_event_cb", instance_pos = -1)]
+// public bool gnome_chess_app_delete_event_cb (Widget widget, Gdk.Event event)
+// {
+// quit_game ();
+// return false;
+// }
private bool prompt_save_game (string prompt_text)
{
@@ -1602,24 +1607,20 @@ Copyright © 2015–2016 Sahil Sareen""";
quit_game ();
}
- [CCode (cname = "white_time_draw_cb", instance_pos = -1)]
- public bool white_time_draw_cb (Widget widget, Cairo.Context c)
+ private inline void white_time_draw_cb (Widget widget, Cairo.Context c)
{
double fg[3] = { 0.0, 0.0, 0.0 };
double bg[3] = { 1.0, 1.0, 1.0 };
draw_time (widget, c, make_clock_text (game.clock, Color.WHITE), fg, bg);
- return false;
}
- [CCode (cname = "black_time_draw_cb", instance_pos = -1)]
- public bool black_time_draw_cb (Widget widget, Cairo.Context c)
+ private inline void black_time_draw_cb (Widget widget, Cairo.Context c)
{
double fg[3] = { 1.0, 1.0, 1.0 };
double bg[3] = { 0.0, 0.0, 0.0 };
draw_time (widget, c, make_clock_text (game.clock, Color.BLACK), fg, bg);
- return false;
}
private string make_clock_text (ChessClock? clock, Color color)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]