From a1356383506bb90b8783b56d4dd3cf0c34fee3a7 Mon Sep 17 00:00:00 2001 From: Matthew Einhorn Date: Tue, 16 Apr 2013 19:07:38 -0400 Subject: [PATCH 1/4] Add test input to color picker. --- kivy/data/style.kv | 90 +++++++++++++++++++++++++--------------------- 1 file changed, 49 insertions(+), 41 deletions(-) diff --git a/kivy/data/style.kv b/kivy/data/style.kv index 7d28a9272..7aad6fa26 100644 --- a/kivy/data/style.kv +++ b/kivy/data/style.kv @@ -844,25 +844,27 @@ GridLayout: cols: 4 size_hint: (.5, 1.) + spacing: [0, '15pt'] Label: text: "R:" color: root.label_color size_hint_x: .25 size_hint_y: .5 - text_size: self.size halign: "right" valign: "middle" font_size: root.size[0] * .045 - Label: - text: str(int(root.color[0] * 255)) - color: root.label_color - size_hint_x: .25 - size_hint_y: .5 - text_size: self.size - halign: "left" - valign: "middle" + TextInput: + multiline: False font_size: root.size[0] * .045 + text: str(int(root.color[0] * 255)) + background_color: root.bg_color + foreground_color: root.label_color + size_hint_x: .25 + size_hint_y: None + height: self.line_height + self.parent.spacing[1] / 2. + border: [0, 0, 0, 0] + on_text: root.color[0] = int(args[1] if args[1] else 0) / 255.0 Label: text: "G:" color: root.label_color @@ -872,15 +874,17 @@ halign: "right" valign: "middle" font_size: root.size[0] * .045 - Label: - text: str(int(root.color[1] * 255)) - color: root.label_color - size_hint_x: .25 - size_hint_y: .5 - text_size: self.size - halign: "left" - valign: "middle" + TextInput: + multiline: False font_size: root.size[0] * .045 + text: str(int(root.color[1] * 255)) + background_color: root.bg_color + foreground_color: root.label_color + size_hint_x: .25 + size_hint_y: None + height: self.line_height + self.parent.spacing[1] / 2. + border: [0, 0, 0, 0] + on_text: root.color[1] = int(args[1] if args[1] else 0) / 255.0 Label: text: "B:" color: root.label_color @@ -890,15 +894,17 @@ halign: "right" valign: "middle" font_size: root.size[0] * .045 - Label: - text: str(int(root.color[2] * 255)) - color: root.label_color - size_hint_x: .25 - size_hint_y: .5 - text_size: self.size - halign: "left" - valign: "middle" + TextInput: + multiline: False font_size: root.size[0] * .045 + text: str(int(root.color[2] * 255)) + background_color: root.bg_color + foreground_color: root.label_color + size_hint_x: .25 + size_hint_y: None + height: self.line_height + self.parent.spacing[1] / 2. + border: [0, 0, 0, 0] + on_text: root.color[2] = int(args[1] if args[1] else 0) / 255.0 Label: text: "A:" color: root.label_color @@ -908,15 +914,17 @@ halign: "right" valign: "middle" font_size: root.size[0] * .045 - Label: - text: str(int(root.color[3] * 255)) - color: root.label_color - size_hint_x: .25 - size_hint_y: .5 - text_size: self.size - halign: "left" - valign: "middle" + TextInput: + multiline: False font_size: root.size[0] * .045 + text: str(int(root.color[3] * 255)) + background_color: root.bg_color + foreground_color: root.label_color + size_hint_x: .25 + size_hint_y: None + height: self.line_height + self.parent.spacing[1] / 2. + border: [0, 0, 0, 0] + on_text: root.color[3] = int(args[1] if args[1] else 0) / 255.0 Widget: size_hint: (.5, 1) canvas: @@ -940,8 +948,8 @@ min: 0 max: 1 step: .01 - value: wheel.r - on_value: wheel.r = args[1] + value: root.color[0] + on_value: root.color[0] = args[1] Slider: id: greenslider size_hint: (1, .6) @@ -949,8 +957,8 @@ min: 0 max: 1 step: .01 - value: wheel.g - on_value: wheel.g = args[1] + value: root.color[1] + on_value: root.color[1] = args[1] Slider: id: blueslider size_hint: (1, .6) @@ -958,8 +966,8 @@ min: 0 max: 1 step: .01 - value: wheel.b - on_value: wheel.b = args[1] + value: root.color[2] + on_value: root.color[2] = args[1] Slider: id: alphaslider size_hint: (1, .6) @@ -967,8 +975,8 @@ min: 0 max: 1 step: .01 - value: wheel.a - on_value: wheel.a = args[1] + value: root.color[3] + on_value: root.color[3] = args[1] Label: size_hint: (1, .2) halign: 'center' From 0345ce58ed429b172f772f31e4a7678a59e421ce Mon Sep 17 00:00:00 2001 From: Matthew Einhorn Date: Tue, 16 Apr 2013 19:44:59 -0400 Subject: [PATCH 2/4] improve sizing. --- kivy/data/style.kv | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/kivy/data/style.kv b/kivy/data/style.kv index 7aad6fa26..f3b643b31 100644 --- a/kivy/data/style.kv +++ b/kivy/data/style.kv @@ -861,8 +861,6 @@ background_color: root.bg_color foreground_color: root.label_color size_hint_x: .25 - size_hint_y: None - height: self.line_height + self.parent.spacing[1] / 2. border: [0, 0, 0, 0] on_text: root.color[0] = int(args[1] if args[1] else 0) / 255.0 Label: @@ -881,8 +879,6 @@ background_color: root.bg_color foreground_color: root.label_color size_hint_x: .25 - size_hint_y: None - height: self.line_height + self.parent.spacing[1] / 2. border: [0, 0, 0, 0] on_text: root.color[1] = int(args[1] if args[1] else 0) / 255.0 Label: @@ -901,8 +897,6 @@ background_color: root.bg_color foreground_color: root.label_color size_hint_x: .25 - size_hint_y: None - height: self.line_height + self.parent.spacing[1] / 2. border: [0, 0, 0, 0] on_text: root.color[2] = int(args[1] if args[1] else 0) / 255.0 Label: @@ -921,8 +915,6 @@ background_color: root.bg_color foreground_color: root.label_color size_hint_x: .25 - size_hint_y: None - height: self.line_height + self.parent.spacing[1] / 2. border: [0, 0, 0, 0] on_text: root.color[3] = int(args[1] if args[1] else 0) / 255.0 Widget: @@ -939,11 +931,10 @@ spacing: 1 padding: 1 GridLayout: - #orientation: 'vertical' rows: 2 Slider: id: redslider - size_hint: (1, .6) + padding: 20 orientation: 'vertical' min: 0 max: 1 @@ -952,7 +943,7 @@ on_value: root.color[0] = args[1] Slider: id: greenslider - size_hint: (1, .6) + padding: 20 orientation: 'vertical' min: 0 max: 1 @@ -961,7 +952,7 @@ on_value: root.color[1] = args[1] Slider: id: blueslider - size_hint: (1, .6) + padding: 20 orientation: 'vertical' min: 0 max: 1 @@ -970,7 +961,7 @@ on_value: root.color[2] = args[1] Slider: id: alphaslider - size_hint: (1, .6) + padding: 20 orientation: 'vertical' min: 0 max: 1 @@ -980,23 +971,27 @@ Label: size_hint: (1, .2) halign: 'center' - valign: 'middle' + valign: 'top' text: 'R' + text_size: self.size Label: size_hint: (1, .2) halign: 'center' - valign: 'middle' + valign: 'top' text: 'G' + text_size: self.size Label: size_hint: (1, .2) halign: 'center' - valign: 'middle' + valign: 'top' text: 'B' + text_size: self.size Label: size_hint: (1, .2) halign: 'center' - valign: 'middle' + valign: 'top' text: 'A' + text_size: self.size ColorWheel: id: wheel From 27b8fa8b44ef16b88898a0a3a778d6bf7db2b0ae Mon Sep 17 00:00:00 2001 From: Matthew Einhorn Date: Tue, 16 Apr 2013 20:11:27 -0400 Subject: [PATCH 3/4] Improve text size. --- kivy/data/style.kv | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kivy/data/style.kv b/kivy/data/style.kv index f3b643b31..109a8a8b4 100644 --- a/kivy/data/style.kv +++ b/kivy/data/style.kv @@ -856,7 +856,7 @@ font_size: root.size[0] * .045 TextInput: multiline: False - font_size: root.size[0] * .045 + font_size: min(root.size[0] * .045, self.height - self.parent.spacing[1] / 2.) text: str(int(root.color[0] * 255)) background_color: root.bg_color foreground_color: root.label_color @@ -874,7 +874,7 @@ font_size: root.size[0] * .045 TextInput: multiline: False - font_size: root.size[0] * .045 + font_size: min(root.size[0] * .045, self.height - self.parent.spacing[1] / 2.) text: str(int(root.color[1] * 255)) background_color: root.bg_color foreground_color: root.label_color @@ -892,7 +892,7 @@ font_size: root.size[0] * .045 TextInput: multiline: False - font_size: root.size[0] * .045 + font_size: min(root.size[0] * .045, self.height - self.parent.spacing[1] / 2.) text: str(int(root.color[2] * 255)) background_color: root.bg_color foreground_color: root.label_color @@ -910,7 +910,7 @@ font_size: root.size[0] * .045 TextInput: multiline: False - font_size: root.size[0] * .045 + font_size: min(root.size[0] * .045, self.height - self.parent.spacing[1] / 2.) text: str(int(root.color[3] * 255)) background_color: root.bg_color foreground_color: root.label_color From f224234cbd2ad051cf8d78f73464618276de4010 Mon Sep 17 00:00:00 2001 From: Matthew Einhorn Date: Sat, 20 Apr 2013 21:18:26 -0400 Subject: [PATCH 4/4] Improve font sizes. --- kivy/data/style.kv | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/kivy/data/style.kv b/kivy/data/style.kv index 109a8a8b4..20a513500 100644 --- a/kivy/data/style.kv +++ b/kivy/data/style.kv @@ -853,15 +853,15 @@ text_size: self.size halign: "right" valign: "middle" - font_size: root.size[0] * .045 + font_size: root.size[0] * .04 TextInput: multiline: False - font_size: min(root.size[0] * .045, self.height - self.parent.spacing[1] / 2.) + font_size: root.size[0] * .040 text: str(int(root.color[0] * 255)) background_color: root.bg_color foreground_color: root.label_color size_hint_x: .25 - border: [0, 0, 0, 0] + border: [2, 2, 2, 2] on_text: root.color[0] = int(args[1] if args[1] else 0) / 255.0 Label: text: "G:" @@ -871,15 +871,15 @@ text_size: self.size halign: "right" valign: "middle" - font_size: root.size[0] * .045 + font_size: root.size[0] * .04 TextInput: multiline: False - font_size: min(root.size[0] * .045, self.height - self.parent.spacing[1] / 2.) + font_size: root.size[0] * .040 text: str(int(root.color[1] * 255)) background_color: root.bg_color foreground_color: root.label_color size_hint_x: .25 - border: [0, 0, 0, 0] + border: [2, 2, 2, 2] on_text: root.color[1] = int(args[1] if args[1] else 0) / 255.0 Label: text: "B:" @@ -889,15 +889,15 @@ text_size: self.size halign: "right" valign: "middle" - font_size: root.size[0] * .045 + font_size: root.size[0] * .04 TextInput: multiline: False - font_size: min(root.size[0] * .045, self.height - self.parent.spacing[1] / 2.) + font_size: root.size[0] * .040 text: str(int(root.color[2] * 255)) background_color: root.bg_color foreground_color: root.label_color size_hint_x: .25 - border: [0, 0, 0, 0] + border: [2, 2, 2, 2] on_text: root.color[2] = int(args[1] if args[1] else 0) / 255.0 Label: text: "A:" @@ -907,15 +907,15 @@ text_size: self.size halign: "right" valign: "middle" - font_size: root.size[0] * .045 + font_size: root.size[0] * .04 TextInput: multiline: False - font_size: min(root.size[0] * .045, self.height - self.parent.spacing[1] / 2.) + font_size: root.size[0] * .040 text: str(int(root.color[3] * 255)) background_color: root.bg_color foreground_color: root.label_color size_hint_x: .25 - border: [0, 0, 0, 0] + border: [2, 2, 2, 2] on_text: root.color[3] = int(args[1] if args[1] else 0) / 255.0 Widget: size_hint: (.5, 1)