[gnome-mahjongg] Remove white spaces.
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-mahjongg] Remove white spaces.
- Date: Thu, 17 Jul 2014 13:41:41 +0000 (UTC)
commit ba9e534919652b49a7c14d1c945c8aa418627e51
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Tue Jul 15 16:14:40 2014 +0200
Remove white spaces.
https://bugzilla.gnome.org/show_bug.cgi?id=733211
src/game-view.vala | 18 +++++++++---------
src/game.vala | 42 +++++++++++++++++++++---------------------
src/gnome-mahjongg.vala | 10 +++++-----
src/map.vala | 6 +++---
src/score-dialog.vala | 4 ++--
5 files changed, 40 insertions(+), 40 deletions(-)
---
diff --git a/src/game-view.vala b/src/game-view.vala
index 53daf8d..3d738d0 100644
--- a/src/game-view.vala
+++ b/src/game-view.vala
@@ -14,7 +14,7 @@ public class GameView : Gtk.DrawingArea
private Cairo.Pattern? tile_pattern = null;
private int tile_pattern_width = 0;
private int tile_pattern_height = 0;
-
+
private int x_offset;
private int y_offset;
private int tile_width;
@@ -41,7 +41,7 @@ public class GameView : Gtk.DrawingArea
get { return _theme; }
set { _theme = value; tile_pattern = null; queue_draw (); }
}
-
+
public GameView ()
{
can_focus = true;
@@ -55,7 +55,7 @@ public class GameView : Gtk.DrawingArea
background_color.red = background_color.green = background_color.blue = 0;
queue_draw ();
}
-
+
private void draw_game (Cairo.Context cr, bool render_indexes = false)
{
if (theme == null)
@@ -155,7 +155,7 @@ public class GameView : Gtk.DrawingArea
{
/* Fall through and try loading as a pixbuf */
}
-
+
try
{
var p = new Gdk.Pixbuf.from_file_at_scale (theme, width, height, false);
@@ -172,14 +172,14 @@ public class GameView : Gtk.DrawingArea
{
var width = get_allocated_width ();
var height = get_allocated_height ();
-
+
if (theme == null)
return;
int theme_width, theme_height;
if (!get_theme_dimensions (out theme_width, out theme_height))
return;
-
+
/* Get aspect ratio from theme - contains 43x2 tiles */
var aspect = ((double) theme_height / 2) / ((double) theme_width / 43);
@@ -219,7 +219,7 @@ public class GameView : Gtk.DrawingArea
return true;
}
}
-
+
private void get_tile_position (Tile tile, out int x, out int y)
{
x = x_offset + tile.slot.x * tile_width / 2 + tile.slot.layer * tile_layer_offset_x;
@@ -246,7 +246,7 @@ public class GameView : Gtk.DrawingArea
/* Everything else is in set order */
return set;
}
-
+
private void redraw_tile_cb (Tile tile)
{
update_dimensions ();
@@ -266,7 +266,7 @@ public class GameView : Gtk.DrawingArea
return false;
Gdk.cairo_set_source_rgba (cr, background_color);
- cr.paint ();
+ cr.paint ();
draw_game (cr);
return true;
diff --git a/src/game.vala b/src/game.vala
index 751d30e..46c7449 100644
--- a/src/game.vala
+++ b/src/game.vala
@@ -19,12 +19,12 @@ public class Tile : Object
{
get { return number / 4; }
}
-
+
public Tile (Slot slot)
{
this.slot = slot;
}
-
+
public bool matches (Tile tile)
{
return tile.set == set;
@@ -52,7 +52,7 @@ public class Match : Object
{
public Tile tile0;
public Tile tile1;
-
+
public Match (Tile tile0, Tile tile1)
{
this.tile0 = tile0;
@@ -150,7 +150,7 @@ public class Game : Object
{
get { return visible_tiles == 0; }
}
-
+
public bool can_move
{
get { return moves_left != 0; }
@@ -184,7 +184,7 @@ public class Game : Object
numbers[n] = t;
}
shuffle (numbers);
-
+
/* Make everything visible again */
reset ();
}
@@ -269,7 +269,7 @@ public class Game : Object
redraw_tile (hint_tiles[0]);
if (hint_tiles[1] != null)
redraw_tile (hint_tiles[1]);
-
+
/* Stop hints */
if (tile0 == null && tile1 == null)
{
@@ -327,7 +327,7 @@ public class Game : Object
var s = t.slot;
/* Can't move if blocked by a tile above */
- if (s.layer == slot.layer + 1 &&
+ if (s.layer == slot.layer + 1 &&
(s.x >= slot.x - 1 && s.x <= slot.x + 1) &&
(s.y >= slot.y - 1 && s.y <= slot.y + 1))
return false;
@@ -360,18 +360,18 @@ public class Game : Object
{
foreach (var match in find_matches (t))
{
- bool already_matched = false;
- foreach (var existing_match in matches)
- {
- if (existing_match.tile0 == match.tile1 && existing_match.tile1 ==
match.tile0)
- {
- already_matched = true;
- break;
- }
- }
-
- if (!already_matched)
- matches.append (match);
+ bool already_matched = false;
+ foreach (var existing_match in matches)
+ {
+ if (existing_match.tile0 == match.tile1 && existing_match.tile1 == match.tile0)
+ {
+ already_matched = true;
+ break;
+ }
+ }
+
+ if (!already_matched)
+ matches.append (match);
}
}
}
@@ -384,7 +384,7 @@ public class Game : Object
if (t.matches (tile))
matches.append (new Match (t, tile));
- }
+ }
}
return matches;
@@ -419,7 +419,7 @@ public class Game : Object
if (complete)
stop_clock ();
else
- start_clock ();
+ start_clock ();
moved ();
diff --git a/src/gnome-mahjongg.vala b/src/gnome-mahjongg.vala
index 66c7d1e..2c0d28c 100644
--- a/src/gnome-mahjongg.vala
+++ b/src/gnome-mahjongg.vala
@@ -60,7 +60,7 @@ public class Mahjongg : Gtk.Application
window = new Gtk.ApplicationWindow (this);
window.configure_event.connect (window_configure_event_cb);
window.window_state_event.connect (window_state_event_cb);
- window.set_default_size (settings.get_int ("window-width"), settings.get_int ("window-height"));
+ window.set_default_size (settings.get_int ("window-width"), settings.get_int ("window-height"));
if (settings.get_boolean ("window-is-maximized"))
window.maximize ();
@@ -77,11 +77,11 @@ public class Mahjongg : Gtk.Application
clock_label = new Gtk.Label ("");
status_box.pack_start (clock_label, false, false, 0);
-
+
var vbox = new Gtk.Box (Gtk.Orientation.VERTICAL, 0);
game_view = new GameView ();
- game_view.button_press_event.connect (view_button_press_event);
+ game_view.button_press_event.connect (view_button_press_event);
game_view.set_size_request (600, 400);
title = new Gtk.Label ("");
@@ -211,7 +211,7 @@ public class Mahjongg : Gtk.Application
is_maximized = (event.new_window_state & Gdk.WindowState.MAXIMIZED) != 0;
return false;
}
-
+
protected override void shutdown ()
{
base.shutdown ();
@@ -677,7 +677,7 @@ public class Mahjongg : Gtk.Application
/* Update clock label */
tick_cb ();
-
+
/* Reset the pause button in case it was set to resume */
var pause_image = (Gtk.Image) pause_button.image;
pause_image.icon_name = "media-playback-pause-symbolic";
diff --git a/src/map.vala b/src/map.vala
index 783d1c8..629abf4 100644
--- a/src/map.vala
+++ b/src/map.vala
@@ -13,7 +13,7 @@ public class Slot : Object
public int x;
public int y;
public int layer;
-
+
public Slot (int x, int y, int layer)
{
this.x = x;
@@ -209,7 +209,7 @@ public class Map : Object
slots.append (new Slot (26, 7, 0));
slots.append (new Slot (28, 7, 0));
}
-
+
public uint width
{
get
@@ -220,7 +220,7 @@ public class Map : Object
if (slot.x > w)
w = slot.x;
}
-
+
/* Width is x location of right most tile and the width of that tile (2 units) */
return w + 2;
}
diff --git a/src/score-dialog.vala b/src/score-dialog.vala
index 2c04f87..3517563 100644
--- a/src/score-dialog.vala
+++ b/src/score-dialog.vala
@@ -7,7 +7,7 @@
* version. See http://www.gnu.org/copyleft/gpl.html the full text of the
* license.
*/
-
+
public class ScoreDialog : Gtk.Dialog
{
private History history;
@@ -166,7 +166,7 @@ public class ScoreDialog : Gtk.Dialog
size_model.append (out iter);
size_model.set (iter, 0, label, 1, entry.name);
-
+
/* Select this entry if don't have any */
if (size_combo.get_active () == -1)
size_combo.set_active_iter (iter);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]