Forráskód Böngészése

tools: add XYZW labels to entry_vector*

Daniele Bartolini 5 éve
szülő
commit
c09d2c8b8a

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

@@ -40,3 +40,7 @@
 .axis.z {
 	background: rgba(0, 0, 120, 0.8);
 }
+
+.axis.w {
+	background: rgba(120, 120, 120, 0.8);
+}

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 2778 - 2777
tools/level_editor/resources/gresources.c


+ 11 - 0
tools/widgets/entry_vector2.vala

@@ -15,6 +15,8 @@ public class EntryVector2 : Gtk.Box
 	// Widgets
 	public EntryDouble _x;
 	public EntryDouble _y;
+	public Gtk.Label _x_label;
+	public Gtk.Label _y_label;
 
 	public Vector2 value
 	{
@@ -49,7 +51,16 @@ public class EntryVector2 : Gtk.Box
 		_x.value_changed.connect(on_value_changed);
 		_y.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");
+
+		this.pack_start(_x_label, false);
 		this.pack_start(_x, true, true);
+		this.pack_start(_y_label, false);
 		this.pack_start(_y, true, true);
 	}
 

+ 21 - 0
tools/widgets/entry_vector4.vala

@@ -17,6 +17,10 @@ public class EntryVector4 : Gtk.Box
 	public EntryDouble _y;
 	public EntryDouble _z;
 	public EntryDouble _w;
+	public Gtk.Label _x_label;
+	public Gtk.Label _y_label;
+	public Gtk.Label _z_label;
+	public Gtk.Label _w_label;
 
 	public Vector4 value
 	{
@@ -57,9 +61,26 @@ public class EntryVector4 : Gtk.Box
 		_z.value_changed.connect(on_value_changed);
 		_w.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");
+		_w_label = new Gtk.Label("Z");
+		_w_label.get_style_context().add_class("axis");
+		_w_label.get_style_context().add_class("w");
+
+		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);
+		this.pack_start(_w_label, false);
 		this.pack_start(_w, true, true);
 	}
 

Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott