mirror of
https://github.com/zebrajr/SamRewritten.git
synced 2025-12-06 12:19:51 +01:00
Some more front end
This commit is contained in:
parent
633ec59fef
commit
b1f890d18d
|
|
@ -4,7 +4,22 @@ GtkAchievementBoxRow::GtkAchievementBoxRow(const Achievement_t& data)
|
|||
:
|
||||
m_data(data)
|
||||
{
|
||||
//TODO create all the BS
|
||||
//TODO achievement icons
|
||||
char ach_title_text[MAX_ACHIEVEMENT_NAME_LENGTH + 7];
|
||||
char ach_player_percent_text[50];
|
||||
char ach_locked_text[9];
|
||||
gboolean pressed;
|
||||
if ( data.achieved ) {
|
||||
sprintf(ach_locked_text, "%s", "Unlocked");
|
||||
pressed = TRUE;
|
||||
} else {
|
||||
sprintf(ach_locked_text, "%s", "Locked");
|
||||
pressed = FALSE;
|
||||
}
|
||||
sprintf(ach_title_text, "<b>%s</b>", data.name);
|
||||
sprintf(ach_player_percent_text, "Achieved by %.1f%% of the players", data.global_achieved_rate);
|
||||
|
||||
|
||||
//TODO create and set new level bar only if ach has progress bar
|
||||
m_main_box = gtk_list_box_row_new();
|
||||
|
||||
|
|
@ -15,21 +30,25 @@ m_data(data)
|
|||
GtkWidget *desc_label = gtk_label_new(data.desc);
|
||||
GtkWidget *more_info_button = gtk_menu_button_new();
|
||||
GtkWidget *more_info_image = gtk_image_new_from_icon_name("gtk-about", GTK_ICON_SIZE_BUTTON);
|
||||
GtkWidget *lock_unlock_button = gtk_toggle_button_new_with_label("TODO");
|
||||
GtkWidget *lock_unlock_button = gtk_toggle_button_new_with_label(ach_locked_text);
|
||||
GtkWidget *popover_menu = gtk_popover_new( more_info_button );
|
||||
GtkWidget *popover_box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 2);
|
||||
GtkWidget *more_info_label = gtk_label_new("");
|
||||
GtkWidget *percentage_players_label = gtk_label_new("Achieved by TODO% of the players");
|
||||
GtkWidget *percentage_players_label = gtk_label_new(ach_player_percent_text);
|
||||
GtkWidget *sep_one = gtk_separator_menu_item_new();
|
||||
GtkWidget *sep_two = gtk_separator_menu_item_new();
|
||||
GtkWidget *progression_label = gtk_label_new("Achievement progress");
|
||||
GtkWidget *ach_level_bar = gtk_level_bar_new(); //gtk_level_bar_new_for_interval (gdouble min_value, gdouble max_value);
|
||||
GtkWidget *ach_progress_label_value = gtk_label_new("TODO / TODO");
|
||||
|
||||
gtk_label_set_markup(GTK_LABEL(title_label), "<b>Text to be bold</b>");
|
||||
gtk_label_set_markup(GTK_LABEL(title_label), ach_title_text);
|
||||
gtk_label_set_markup(GTK_LABEL(more_info_label), "<b>Additional information</b>");
|
||||
gtk_widget_set_size_request(m_main_box, -1, 80);
|
||||
gtk_menu_button_set_popover(GTK_MENU_BUTTON(more_info_button), GTK_WIDGET(popover_menu));
|
||||
gtk_widget_set_valign(GTK_WIDGET(more_info_button), GTK_ALIGN_CENTER);
|
||||
gtk_widget_set_size_request(GTK_WIDGET(more_info_button), -1, 34);
|
||||
gtk_widget_set_margin_end(GTK_WIDGET(more_info_button), 10);
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(lock_unlock_button), pressed);
|
||||
|
||||
gtk_container_add(GTK_CONTAINER(more_info_button), GTK_WIDGET(more_info_image));
|
||||
gtk_box_pack_start(GTK_BOX(title_desc_box), GTK_WIDGET(title_label), FALSE, TRUE, 0);
|
||||
|
|
|
|||
|
|
@ -34,8 +34,8 @@
|
|||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">It doesn't look like Sam could find anything interesting here...
|
||||
You can still wait for him to bring more results</property>
|
||||
<property name="label" translatable="yes">Sam is currently fetching your games!
|
||||
He's pretty confident they won't take much longer to arrive, but is also wrong most of the time.</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
|
|
@ -262,11 +262,13 @@ You can still wait for him to bring more results</property>
|
|||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<object class="GtkSpinner">
|
||||
<property name="width_request">34</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="pixel_size">35</property>
|
||||
<property name="icon_name">face-glasses</property>
|
||||
<property name="hexpand">False</property>
|
||||
<property name="vexpand">False</property>
|
||||
<property name="active">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
|
|
@ -278,8 +280,7 @@ You can still wait for him to bring more results</property>
|
|||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Sam is still fetching the stats and achievements.
|
||||
He's pretty confident they won't take much longer to arrive, but is also wrong most of the time.</property>
|
||||
<property name="label" translatable="yes">Please wait while SAM fetches the results</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user