Просмотр исходного кода

tools: use add_resource_path() instead of deprecated add_builtin_icon()

Daniele Bartolini 7 лет назад
Родитель
Сommit
650ae43368

Разница между файлами не показана из-за своего большого размера
+ 363 - 2789
tools/gresources.c


+ 14 - 14
tools/gresources.xml

@@ -12,20 +12,20 @@
 		<file>ui/icons/32x32/pepper.png</file>
 		<file>ui/icons/64x64/pepper.png</file>
 
-		<file>ui/icons/theme/axis-local.png</file>
-		<file>ui/icons/theme/axis-world.png</file>
-		<file>ui/icons/theme/layer-locked.png</file>
-		<file>ui/icons/theme/layer-visible.png</file>
-		<file>ui/icons/theme/level-layers.png</file>
-		<file>ui/icons/theme/level-tree.png</file>
-		<file>ui/icons/theme/reference-local.png</file>
-		<file>ui/icons/theme/reference-world.png</file>
-		<file>ui/icons/theme/run.png</file>
-		<file>ui/icons/theme/snap-to-grid.png</file>
-		<file>ui/icons/theme/tool-move.png</file>
-		<file>ui/icons/theme/tool-place.png</file>
-		<file>ui/icons/theme/tool-rotate.png</file>
-		<file>ui/icons/theme/tool-scale.png</file>
+		<file>ui/icons/theme/16x16/actions/axis-local.png</file>
+		<file>ui/icons/theme/16x16/actions/axis-world.png</file>
+		<file>ui/icons/theme/16x16/actions/layer-locked.png</file>
+		<file>ui/icons/theme/16x16/actions/layer-visible.png</file>
+		<file>ui/icons/theme/16x16/actions/level-layers.png</file>
+		<file>ui/icons/theme/16x16/actions/level-tree.png</file>
+		<file>ui/icons/theme/16x16/actions/reference-local.png</file>
+		<file>ui/icons/theme/16x16/actions/reference-world.png</file>
+		<file>ui/icons/theme/16x16/actions/run.png</file>
+		<file>ui/icons/theme/16x16/actions/snap-to-grid.png</file>
+		<file>ui/icons/theme/16x16/actions/tool-move.png</file>
+		<file>ui/icons/theme/16x16/actions/tool-place.png</file>
+		<file>ui/icons/theme/16x16/actions/tool-rotate.png</file>
+		<file>ui/icons/theme/16x16/actions/tool-scale.png</file>
 
 		<file compressed="true">ui/theme/style.css</file>
 	</gresource>

+ 1 - 21
tools/level_editor/level_editor.vala

@@ -1415,27 +1415,7 @@ namespace Crown
 		Gtk.StyleContext.add_provider_for_screen(screen, provider, STYLE_PROVIDER_PRIORITY_APPLICATION);
 		provider.load_from_resource("/org/crown/ui/theme/style.css");
 
-		try
-		{
-			Gtk.IconTheme.add_builtin_icon("tool-place",      16, new Pixbuf.from_resource("/org/crown/ui/icons/theme/tool-place.png"));
-			Gtk.IconTheme.add_builtin_icon("tool-move",       16, new Pixbuf.from_resource("/org/crown/ui/icons/theme/tool-move.png"));
-			Gtk.IconTheme.add_builtin_icon("tool-rotate",     16, new Pixbuf.from_resource("/org/crown/ui/icons/theme/tool-rotate.png"));
-			Gtk.IconTheme.add_builtin_icon("tool-scale",      16, new Pixbuf.from_resource("/org/crown/ui/icons/theme/tool-scale.png"));
-			Gtk.IconTheme.add_builtin_icon("axis-local",      16, new Pixbuf.from_resource("/org/crown/ui/icons/theme/axis-local.png"));
-			Gtk.IconTheme.add_builtin_icon("axis-world",      16, new Pixbuf.from_resource("/org/crown/ui/icons/theme/axis-world.png"));
-			Gtk.IconTheme.add_builtin_icon("snap-to-grid",    16, new Pixbuf.from_resource("/org/crown/ui/icons/theme/snap-to-grid.png"));
-			Gtk.IconTheme.add_builtin_icon("reference-local", 16, new Pixbuf.from_resource("/org/crown/ui/icons/theme/reference-local.png"));
-			Gtk.IconTheme.add_builtin_icon("reference-world", 16, new Pixbuf.from_resource("/org/crown/ui/icons/theme/reference-world.png"));
-			Gtk.IconTheme.add_builtin_icon("run",             16, new Pixbuf.from_resource("/org/crown/ui/icons/theme/run.png"));
-			Gtk.IconTheme.add_builtin_icon("level-tree",      16, new Pixbuf.from_resource("/org/crown/ui/icons/theme/level-tree.png"));
-			Gtk.IconTheme.add_builtin_icon("level-layers",    16, new Pixbuf.from_resource("/org/crown/ui/icons/theme/level-layers.png"));
-			Gtk.IconTheme.add_builtin_icon("layer-visible",   16, new Pixbuf.from_resource("/org/crown/ui/icons/theme/layer-visible.png"));
-			Gtk.IconTheme.add_builtin_icon("layer-locked",    16, new Pixbuf.from_resource("/org/crown/ui/icons/theme/layer-locked.png"));
-		}
-		catch (Error e)
-		{
-			stderr.printf(e.message);
-		}
+		Gtk.IconTheme.get_default().add_resource_path("/org/crown/ui/icons/theme");
 
 		bool create_initial_files = false;
 		string source_dir = "";

+ 20 - 20
tools/makefile

@@ -3,27 +3,27 @@ OBJS = \
 	level_editor/preferences_dialog.ui \
 	level_editor/project_dialog.ui     \
 \
-	ui/icons/128x128/pepper.png        \
-	ui/icons/16x16/pepper.png          \
-	ui/icons/24x24/pepper.png          \
-	ui/icons/256x256/pepper.png        \
-	ui/icons/32x32/pepper.png          \
-	ui/icons/64x64/pepper.png          \
+	ui/icons/128x128/pepper.png \
+	ui/icons/16x16/pepper.png   \
+	ui/icons/24x24/pepper.png   \
+	ui/icons/256x256/pepper.png \
+	ui/icons/32x32/pepper.png   \
+	ui/icons/64x64/pepper.png   \
 \
-	ui/icons/theme/axis-local.png      \
-	ui/icons/theme/axis-world.png      \
-	ui/icons/theme/layer-locked.png    \
-	ui/icons/theme/layer-visible.png   \
-	ui/icons/theme/level-layers.png    \
-	ui/icons/theme/level-tree.png      \
-	ui/icons/theme/reference-local.png \
-	ui/icons/theme/reference-world.png \
-	ui/icons/theme/run.png             \
-	ui/icons/theme/snap-to-grid.png    \
-	ui/icons/theme/tool-move.png       \
-	ui/icons/theme/tool-place.png      \
-	ui/icons/theme/tool-rotate.png     \
-	ui/icons/theme/tool-scale.png      \
+	ui/icons/theme/16x16/actions/axis-local.png      \
+	ui/icons/theme/16x16/actions/axis-world.png      \
+	ui/icons/theme/16x16/actions/layer-locked.png    \
+	ui/icons/theme/16x16/actions/layer-visible.png   \
+	ui/icons/theme/16x16/actions/level-layers.png    \
+	ui/icons/theme/16x16/actions/level-tree.png      \
+	ui/icons/theme/16x16/actions/reference-local.png \
+	ui/icons/theme/16x16/actions/reference-world.png \
+	ui/icons/theme/16x16/actions/run.png             \
+	ui/icons/theme/16x16/actions/snap-to-grid.png    \
+	ui/icons/theme/16x16/actions/tool-move.png       \
+	ui/icons/theme/16x16/actions/tool-place.png      \
+	ui/icons/theme/16x16/actions/tool-rotate.png     \
+	ui/icons/theme/16x16/actions/tool-scale.png      \
 
 .PHONY: all
 all: gresources.xml $(OBJS)

+ 0 - 0
tools/ui/icons/theme/axis-local.png → tools/ui/icons/theme/16x16/actions/axis-local.png


+ 0 - 0
tools/ui/icons/theme/axis-world.png → tools/ui/icons/theme/16x16/actions/axis-world.png


+ 0 - 0
tools/ui/icons/theme/layer-locked.png → tools/ui/icons/theme/16x16/actions/layer-locked.png


+ 0 - 0
tools/ui/icons/theme/layer-visible.png → tools/ui/icons/theme/16x16/actions/layer-visible.png


+ 0 - 0
tools/ui/icons/theme/level-layers.png → tools/ui/icons/theme/16x16/actions/level-layers.png


+ 0 - 0
tools/ui/icons/theme/level-tree.png → tools/ui/icons/theme/16x16/actions/level-tree.png


+ 0 - 0
tools/ui/icons/theme/reference-local.png → tools/ui/icons/theme/16x16/actions/reference-local.png


+ 0 - 0
tools/ui/icons/theme/reference-world.png → tools/ui/icons/theme/16x16/actions/reference-world.png


+ 0 - 0
tools/ui/icons/theme/run.png → tools/ui/icons/theme/16x16/actions/run.png


+ 0 - 0
tools/ui/icons/theme/snap-to-grid.png → tools/ui/icons/theme/16x16/actions/snap-to-grid.png


+ 0 - 0
tools/ui/icons/theme/tool-move.png → tools/ui/icons/theme/16x16/actions/tool-move.png


+ 0 - 0
tools/ui/icons/theme/tool-place.png → tools/ui/icons/theme/16x16/actions/tool-place.png


+ 0 - 0
tools/ui/icons/theme/tool-rotate.png → tools/ui/icons/theme/16x16/actions/tool-rotate.png


+ 0 - 0
tools/ui/icons/theme/tool-scale.png → tools/ui/icons/theme/16x16/actions/tool-scale.png


Некоторые файлы не были показаны из-за большого количества измененных файлов