Ver código fonte

tools: improve the look of EntryVector3

Daniele Bartolini 5 anos atrás
pai
commit
1650a87976

+ 2 - 1
docs/changelog.rst

@@ -27,6 +27,7 @@ Changelog
 * Fixed an issue that caused the Level Editor to not include "core/units/camera" in the boot.package of a newly created project
 * Fixed an issue that caused the Level Editor to start the Editor View before data compilation was done in some circumstances
 * Fixed main.lua files generated by Level Editor for new projects
+* Improved look of EntryVector3 widget
 * Lua reloading has been extended to the running game when pressing F5 from the Level Editor
 * Nodes in the Level Tree can now be exanded by clicking on the corresponding row
 * Preferences are now saved to the user's config directory
@@ -34,7 +35,7 @@ Changelog
 * The Editor View will now show a message explaining how to recover the session after a crash or unintended disconnection
 * Unified the asset import dialogs
 
-** Samples **
+**Samples**
 
 * Unified projects directory structure
 

+ 18 - 0
tools/level_editor/resources/css/style.css

@@ -22,3 +22,21 @@
 	min-height: 22px;
 	padding-left: 12px;
 }
+
+.axis {
+	min-width: 22px;
+	font-weight: bold;
+	border-radius: 4px 0px 0px 4px;
+}
+
+.axis.x {
+	background: rgba(120, 0, 0, 0.8);
+}
+
+.axis.y {
+	background: rgba(0, 120, 0, 0.8);
+}
+
+.axis.z {
+	background: rgba(0, 0, 120, 0.8);
+}

Diferenças do arquivo suprimidas por serem muito extensas
+ 2238 - 2234
tools/level_editor/resources/gresources.c


+ 16 - 0
tools/widgets/entry_vector3.vala

@@ -16,6 +16,9 @@ namespace Crown
 		public EntryDouble _x;
 		public EntryDouble _y;
 		public EntryDouble _z;
+		public Gtk.Label _x_label;
+		public Gtk.Label _y_label;
+		public Gtk.Label _z_label;
 
 		public Vector3 value
 		{
@@ -53,8 +56,21 @@ namespace Crown
 			_y.value_changed.connect(on_value_changed);
 			_z.value_changed.connect(on_value_changed);
 
+			_x_label = new Gtk.Label("X");
+			_x_label.get_style_context().add_class("axis");
+			_x_label.get_style_context().add_class("x");
+			_y_label = new Gtk.Label("Y");
+			_y_label.get_style_context().add_class("axis");
+			_y_label.get_style_context().add_class("y");
+			_z_label = new Gtk.Label("Z");
+			_z_label.get_style_context().add_class("axis");
+			_z_label.get_style_context().add_class("z");
+
+			this.pack_start(_x_label, false);
 			this.pack_start(_x, true, true);
+			this.pack_start(_y_label, false);
 			this.pack_start(_y, true, true);
+			this.pack_start(_z_label, false);
 			this.pack_start(_z, true, true);
 		}
 

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff