[gnome-chess] Use the headerbar for messages
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-chess] Use the headerbar for messages
- Date: Tue, 7 Jan 2014 16:51:54 +0000 (UTC)
commit cfc90e34a7a6506f9d8ab034af9c94c67bca5598
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Tue Jan 7 10:11:45 2014 -0600
Use the headerbar for messages
Drop the infobar that forced the chessboard to resize.
src/gnome-chess.vala | 29 ++++-------------------------
1 files changed, 4 insertions(+), 25 deletions(-)
---
diff --git a/src/gnome-chess.vala b/src/gnome-chess.vala
index 902e075..21d3de6 100644
--- a/src/gnome-chess.vala
+++ b/src/gnome-chess.vala
@@ -16,9 +16,6 @@ public class Application : Gtk.Application
private Gtk.Builder builder;
private Gtk.Builder preferences_builder;
private Gtk.ApplicationWindow window;
- private Gtk.InfoBar info_bar;
- private Gtk.Label info_title_label;
- private Gtk.Label info_label;
private Gtk.Container view_container;
private ChessScene scene;
private ChessView view;
@@ -139,7 +136,6 @@ public class Application : Gtk.Application
history_combo = (Gtk.ComboBox) builder.get_object ("history_combo");
white_time_label = (Gtk.Widget) builder.get_object ("white_time_label");
black_time_label = (Gtk.Widget) builder.get_object ("black_time_label");
- var view_box = (Gtk.Box) builder.get_object ("view_box");
view_container = (Gtk.Container) builder.get_object ("view_container");
headerbar = (Gtk.HeaderBar) builder.get_object ("headerbar");
builder.connect_signals (this);
@@ -155,21 +151,6 @@ public class Application : Gtk.Application
window.icon_name = "gnome-chess";
add_window (window);
- info_bar = new Gtk.InfoBar ();
- var content_area = (Gtk.Container) info_bar.get_content_area ();
- view_box.pack_start (info_bar, false, true, 0);
- var vbox = new Gtk.Box (Gtk.Orientation.VERTICAL, 6);
- vbox.show ();
- content_area.add (vbox);
- info_title_label = new Gtk.Label ("");
- info_title_label.show ();
- vbox.pack_start (info_title_label, false, true, 0);
- vbox.hexpand = true;
- vbox.vexpand = false;
- info_label = new Gtk.Label ("");
- info_label.show ();
- vbox.pack_start (info_label, true, true, 0);
-
scene = new ChessScene ();
scene.is_human.connect ((p) => { return p == human_player; } );
scene.changed.connect (scene_changed_cb);
@@ -472,9 +453,6 @@ public class Application : Gtk.Application
game.clock.tick.connect (game_clock_tick_cb);
scene.game = game;
- info_bar.hide ();
- update_history_panel ();
- update_action_status ();
var white_engine = pgn_game.white_ai;
var white_level = pgn_game.white_level;
@@ -569,6 +547,8 @@ public class Application : Gtk.Application
if (game.result != ChessResult.IN_PROGRESS)
game_end_cb (game);
+ update_history_panel ();
+ update_action_status ();
update_headerbar_title ();
white_time_label.queue_draw ();
@@ -1177,9 +1157,8 @@ public class Application : Gtk.Application
break;
}
- info_title_label.set_markup ("<big><b>%s</b></big>".printf (title));
- info_label.set_text (reason);
- info_bar.show ();
+ headerbar.set_title (title);
+ headerbar.set_subtitle (reason);
white_time_label.queue_draw ();
black_time_label.queue_draw ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]