[gnome-mines] Avoid unnecessary icon regeneration.
- From: Robert Roth <robertroth src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-mines] Avoid unnecessary icon regeneration.
- Date: Fri, 12 Oct 2018 05:39:00 +0000 (UTC)
commit 9b20700b752e5d86f5a6adb8fc9439431e0aaf79
Author: Yanko Kaneti <yaneti declera com>
Date: Wed Oct 10 19:08:43 2018 +0300
Avoid unnecessary icon regeneration.
Leave the gtk css engine to handle the icon redraw
on theme change
src/gnome-mines.vala | 2 --
src/minefield-view.vala | 8 --------
src/theme-selector-dialog.vala | 3 ---
src/tile.vala | 11 -----------
4 files changed, 24 deletions(-)
---
diff --git a/src/gnome-mines.vala b/src/gnome-mines.vala
index 6c53b62..e14a6ff 100644
--- a/src/gnome-mines.vala
+++ b/src/gnome-mines.vala
@@ -157,8 +157,6 @@ public class Mines : Gtk.Application
if (theme_dialog != null)
theme_dialog.queue_draw ();
- if (minefield_view != null)
- minefield_view.refresh ();
}
protected override void startup ()
diff --git a/src/minefield-view.vala b/src/minefield-view.vala
index 35bf876..1ec1672 100644
--- a/src/minefield-view.vala
+++ b/src/minefield-view.vala
@@ -527,14 +527,6 @@ public class MinefieldView : Gtk.Grid
return true;
}
- public void refresh ()
- {
- if (_minefield != null)
- for (int i = 0; i < _minefield.width; i++)
- for (int j = 0; j < _minefield.height; j++)
- mines[i,j].refresh_icon ();
- }
-
public override bool key_release_event (Gdk.EventKey event)
{
if (event.keyval != Gdk.Key.space)
diff --git a/src/theme-selector-dialog.vala b/src/theme-selector-dialog.vala
index b804abf..2eb86a4 100644
--- a/src/theme-selector-dialog.vala
+++ b/src/theme-selector-dialog.vala
@@ -158,19 +158,16 @@ public class ThemeSelectorDialog : Gtk.Dialog
next.clicked.connect (() => {
switch_theme_preview (++current_index, themes);
update_sensitivities (themes, current_index);
- minefield.refresh ();
});
previous.clicked.connect (() => {
switch_theme_preview (--current_index, themes);
update_sensitivities (themes, current_index);
- minefield.refresh ();
});
set_size_request (420, 400);
update_sensitivities (themes, current_index);
show_all ();
- minefield.refresh ();
}
private void switch_theme_preview (int to_index, List<string> themes)
diff --git a/src/tile.vala b/src/tile.vala
index e9e6acf..3c5d809 100644
--- a/src/tile.vala
+++ b/src/tile.vala
@@ -21,17 +21,6 @@ public class Tile : Gtk.Button
get { return _column; }
}
- public void refresh_icon ()
- {
- string name;
- Gtk.IconSize size;
- scaling_image.get_icon_name (out name, out size);
- scaling_image.clear ();
- scaling_image.set_from_icon_name (name, size);
- scaling_image.set_pixel_size (get_allocated_height ()/3*2);
- set_image (scaling_image);
- }
-
public Tile (int prow, int pcol)
{
_row = prow;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]