feat: move the results graph to the top left and truncate text

master
Dominique Merle 4 years ago
parent 1120763782
commit 0b877eeaff

@ -11,6 +11,9 @@ const MeritProfileScene = preload("res://addons/majority_judgment/nodes/Majority
export(Resource) var poll setget set_poll, get_poll
export(int) var vertical_gap := 4 # pixels
export(int) var candidates_labels_width := 200 # pixels
onready var ProfilesContainer = find_node("ProfilesContainer", true)
var provider:MajorityJudgmentAbstractJudgmentsProvider
@ -43,7 +46,7 @@ func craft_nodes():
var height = profile.compute_height()
profile.rect_min_size = Vector2(400, height)
var container = $CenterContainer/ProfilesContainer
var container = self.ProfilesContainer
var wrapper = HBoxContainer.new()
wrapper.name = "Candidate%sLine" % char(candidate_index+65)
@ -62,7 +65,10 @@ func craft_nodes():
candidate_label.text = candidate.get_name()
candidate_label.size_flags_horizontal = Control.SIZE_EXPAND_FILL
# candidate_label.size_flags_vertical = Control.SIZE_EXPAND_FILL
candidate_label.rect_min_size = Vector2(70, height)
candidate_label.rect_min_size = Vector2(candidates_labels_width, height)
candidate_label.rect_size = Vector2(candidates_labels_width, height)
candidate_label.clip_text = true
candidate_label.autowrap = true
candidate_label.valign = Label.VALIGN_CENTER
candidate_label.align = Label.ALIGN_RIGHT
wrapper.add_child(candidate_label)

@ -10,6 +10,12 @@ __meta__ = {
"_edit_use_anchors_": false
}
[node name="ProfilesContainer" type="Control" parent="."]
rect_min_size = Vector2( 600, 400 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="CenterContainer" type="CenterContainer" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
@ -17,11 +23,4 @@ __meta__ = {
"_edit_use_anchors_": false
}
[node name="ProfilesContainer" type="Control" parent="CenterContainer"]
margin_left = 212.0
margin_top = 99.0
margin_right = 812.0
margin_bottom = 499.0
rect_min_size = Vector2( 600, 400 )
[node name="Tween" type="Tween" parent="."]

Loading…
Cancel
Save