taddon_list: updated GUI2 addons manager layout
This commit is contained in:
parent
3359961b00
commit
a60d8d8daf
3 changed files with 184 additions and 51 deletions
|
@ -122,6 +122,15 @@
|
|||
[/toggle_button]
|
||||
[/column]
|
||||
|
||||
[column]
|
||||
grow_factor = 1
|
||||
horizontal_grow = "true"
|
||||
|
||||
[spacer]
|
||||
linked_group = "control_buttons"
|
||||
[/spacer]
|
||||
[/column]
|
||||
|
||||
[/row]
|
||||
|
||||
[/header]
|
||||
|
@ -232,7 +241,7 @@
|
|||
|
||||
[label]
|
||||
id = "version"
|
||||
definition = "default"
|
||||
definition = "default_small"
|
||||
linked_group = "version"
|
||||
wrap = "true"
|
||||
[/label]
|
||||
|
@ -248,7 +257,7 @@
|
|||
|
||||
[label]
|
||||
id = "author"
|
||||
definition = "default"
|
||||
definition = "default_small"
|
||||
linked_group = "author"
|
||||
wrap = "true"
|
||||
characters_per_line = 20
|
||||
|
@ -265,7 +274,7 @@
|
|||
|
||||
[label]
|
||||
id = "size"
|
||||
definition = "default"
|
||||
definition = "default_small"
|
||||
linked_group = "size"
|
||||
wrap = "true"
|
||||
[/label]
|
||||
|
@ -281,7 +290,7 @@
|
|||
|
||||
[label]
|
||||
id = "downloads"
|
||||
definition = "default"
|
||||
definition = "default_small"
|
||||
linked_group = "downloads"
|
||||
wrap = "true"
|
||||
[/label]
|
||||
|
@ -297,13 +306,98 @@
|
|||
|
||||
[label]
|
||||
id = "type"
|
||||
definition = "default"
|
||||
definition = "default_small"
|
||||
linked_group = "type"
|
||||
wrap = "true"
|
||||
[/label]
|
||||
|
||||
[/column]
|
||||
|
||||
[column]
|
||||
|
||||
[grid]
|
||||
linked_group = "control_buttons"
|
||||
|
||||
[row]
|
||||
|
||||
[column]
|
||||
|
||||
[stacked_widget]
|
||||
id = "install_update_stack"
|
||||
definition = "default"
|
||||
|
||||
[stack]
|
||||
|
||||
[layer]
|
||||
|
||||
[row]
|
||||
|
||||
[column]
|
||||
grow_factor = 1
|
||||
horizontal_grow = "true"
|
||||
|
||||
border = "all"
|
||||
border_size = 5
|
||||
|
||||
[button]
|
||||
id = "single_install"
|
||||
definition = "install"
|
||||
[/button]
|
||||
|
||||
[/column]
|
||||
|
||||
[/row]
|
||||
|
||||
[/layer]
|
||||
|
||||
[layer]
|
||||
|
||||
[row]
|
||||
|
||||
[column]
|
||||
grow_factor = 1
|
||||
horizontal_grow = "true"
|
||||
|
||||
border = "all"
|
||||
border_size = 5
|
||||
|
||||
[button]
|
||||
id = "single_update"
|
||||
definition = "update"
|
||||
[/button]
|
||||
|
||||
[/column]
|
||||
|
||||
[/row]
|
||||
|
||||
[/layer]
|
||||
|
||||
[/stack]
|
||||
|
||||
[/stacked_widget]
|
||||
|
||||
[/column]
|
||||
|
||||
[column]
|
||||
grow_factor = 1
|
||||
horizontal_grow = "true"
|
||||
|
||||
border = "all"
|
||||
border_size = 5
|
||||
|
||||
[button]
|
||||
id = "single_uninstall"
|
||||
definition = "uninstall"
|
||||
[/button]
|
||||
|
||||
[/column]
|
||||
|
||||
[/row]
|
||||
|
||||
[/grid]
|
||||
|
||||
[/column]
|
||||
|
||||
[/row]
|
||||
|
||||
[/grid]
|
||||
|
@ -476,7 +570,7 @@
|
|||
|
||||
[scroll_label]
|
||||
id = "description"
|
||||
definition = "description"
|
||||
#definition = "description"
|
||||
label = _ "No description available."
|
||||
|
||||
horizontal_scrollbar_mode = "never"
|
||||
|
@ -870,13 +964,13 @@
|
|||
|
||||
[/row]
|
||||
|
||||
[row]
|
||||
[column]
|
||||
[spacer]
|
||||
height = 10
|
||||
[/spacer]
|
||||
[/column]
|
||||
[/row]
|
||||
#[row]
|
||||
# [column]
|
||||
# [spacer]
|
||||
# height = 10
|
||||
# [/spacer]
|
||||
# [/column]
|
||||
#[/row]
|
||||
|
||||
[row]
|
||||
grow_factor = 0
|
||||
|
@ -899,9 +993,7 @@
|
|||
[button]
|
||||
id = "install"
|
||||
return_value_id = "ok"
|
||||
definition = "large"
|
||||
|
||||
label = "Install"
|
||||
definition = "addon_install"
|
||||
[/button]
|
||||
|
||||
[/column]
|
||||
|
@ -915,9 +1007,7 @@
|
|||
[button]
|
||||
id = "uninstall"
|
||||
return_value_id = "ok"
|
||||
definition = "large"
|
||||
|
||||
label = "Uninstall"
|
||||
definition = "addon_uninstall"
|
||||
[/button]
|
||||
|
||||
[/column]
|
||||
|
@ -986,7 +1076,7 @@
|
|||
[/column]
|
||||
|
||||
[column]
|
||||
grow_factor = 0
|
||||
grow_factor = 1
|
||||
border = "all"
|
||||
border_size = 5
|
||||
|
||||
|
@ -1018,16 +1108,29 @@
|
|||
[/column]
|
||||
|
||||
[column]
|
||||
grow_factor = 1
|
||||
grow_factor = 0
|
||||
border = "all"
|
||||
border_size = 5
|
||||
horizontal_alignment = "right"
|
||||
|
||||
[button]
|
||||
id = "options"
|
||||
definition = "default"
|
||||
definition = "settings"
|
||||
[/button]
|
||||
|
||||
label = "Filter Options"
|
||||
[/column]
|
||||
|
||||
[column]
|
||||
grow_factor = 0
|
||||
border = "all"
|
||||
border_size = 5
|
||||
horizontal_alignment = "right"
|
||||
|
||||
[button]
|
||||
# NOTE: this isn't named "help" because it conflicts with
|
||||
# a titlescreen hack in gui2::twindow::get_retval_by_id().
|
||||
id = "show_help"
|
||||
definition = "help_30"
|
||||
[/button]
|
||||
|
||||
[/column]
|
||||
|
@ -1044,13 +1147,7 @@
|
|||
[resolution]
|
||||
definition = "borderless"
|
||||
|
||||
automatic_placement = "false"
|
||||
|
||||
x = 0
|
||||
y = 0
|
||||
|
||||
width = "(screen_width)"
|
||||
height = "(screen_height)"
|
||||
{GUI_WINDOW_FULLSCREEN}
|
||||
|
||||
[linked_group]
|
||||
id = "icon"
|
||||
|
@ -1087,6 +1184,11 @@
|
|||
fixed_width = "true"
|
||||
[/linked_group]
|
||||
|
||||
[linked_group]
|
||||
id = "control_buttons"
|
||||
fixed_width = "true"
|
||||
[/linked_group]
|
||||
|
||||
[linked_group]
|
||||
id = "toggle"
|
||||
fixed_width = "true"
|
||||
|
@ -1127,14 +1229,15 @@
|
|||
[/row]
|
||||
|
||||
[row]
|
||||
grow_factor = 0
|
||||
|
||||
[column]
|
||||
grow_factor = 1
|
||||
grow_factor = 0
|
||||
horizontal_grow = "true"
|
||||
vertical_grow = "true"
|
||||
|
||||
border = "top"
|
||||
border_size = 5
|
||||
#border = "top"
|
||||
#border_size = 5
|
||||
|
||||
{_GUI_ADDON_FILTER_OPTIONS}
|
||||
|
||||
|
@ -1142,6 +1245,8 @@
|
|||
|
||||
[/row]
|
||||
|
||||
{GUI_HORIZONTAL_SPACER_LINE}
|
||||
|
||||
[row]
|
||||
grow_factor = 1
|
||||
|
||||
|
@ -1197,24 +1302,6 @@
|
|||
grow_factor = 1
|
||||
border = "all"
|
||||
border_size = 5
|
||||
horizontal_alignment = "left"
|
||||
vertical_alignment = "bottom"
|
||||
|
||||
[button]
|
||||
# NOTE: this isn't named "help" because it conflicts with
|
||||
# a titlescreen hack in gui2::twindow::get_retval_by_id().
|
||||
id = "show_help"
|
||||
definition = "default"
|
||||
|
||||
label = "Help"
|
||||
[/button]
|
||||
|
||||
[/column]
|
||||
|
||||
[column]
|
||||
grow_factor = 0
|
||||
border = "all"
|
||||
border_size = 5
|
||||
horizontal_alignment = "right"
|
||||
|
||||
[button]
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include "desktop/clipboard.hpp"
|
||||
#include "desktop/open.hpp"
|
||||
|
||||
#include "help/help.hpp"
|
||||
#include "gettext.hpp"
|
||||
#include "gui/auxiliary/filter.hpp"
|
||||
#include "gui/auxiliary/find_widget.hpp"
|
||||
|
@ -41,12 +42,14 @@
|
|||
#include "gui/widgets/toggle_button.hpp"
|
||||
#include "gui/widgets/text_box.hpp"
|
||||
#include "gui/widgets/window.hpp"
|
||||
#include "gui/dialogs/addon/filter_options.hpp"
|
||||
#include "serialization/string_utils.hpp"
|
||||
#include "formula/string_utils.hpp"
|
||||
#include "marked-up_text.hpp"
|
||||
#include "font.hpp"
|
||||
#include "preferences.hpp"
|
||||
#include "strftime.hpp"
|
||||
#include "video.hpp"
|
||||
|
||||
#include "config.hpp"
|
||||
|
||||
|
@ -414,6 +417,21 @@ void taddon_list::pre_show(twindow& window)
|
|||
data.insert(std::make_pair("type", item));
|
||||
|
||||
list.add_row(data);
|
||||
|
||||
tgrid* row_grid = list.get_row_grid(list.get_item_count() - 1);
|
||||
|
||||
tstacked_widget& install_update_stack = find_widget<tstacked_widget>(row_grid, "install_update_stack", false);
|
||||
|
||||
const bool is_updatable = tracking_info_[info.id].state == ADDON_INSTALLED_UPGRADABLE;
|
||||
const bool is_installed = tracking_info_[info.id].state == ADDON_INSTALLED;
|
||||
|
||||
install_update_stack.select_layer(is_updatable);
|
||||
|
||||
if(!is_updatable) {
|
||||
find_widget<tbutton>(row_grid, "single_install", false).set_active(!is_installed);
|
||||
}
|
||||
|
||||
find_widget<tbutton>(row_grid, "single_uninstall", false).set_active(is_installed);
|
||||
}
|
||||
|
||||
register_sort_button_alphabetical(window, "sort_name", "name");
|
||||
|
@ -460,9 +478,35 @@ void taddon_list::pre_show(twindow& window)
|
|||
url_copy_button,
|
||||
std::bind(&taddon_list::copy_url_callback, this, std::ref(url_textbox)));
|
||||
|
||||
connect_signal_mouse_left_click(
|
||||
find_widget<tbutton>(&window, "options", false),
|
||||
std::bind(&options_button_callback, this, std::ref(window)));
|
||||
|
||||
connect_signal_mouse_left_click(
|
||||
find_widget<tbutton>(&window, "show_help", false),
|
||||
std::bind(&show_help, this, std::ref(window)));
|
||||
|
||||
on_addon_select(window);
|
||||
}
|
||||
|
||||
void taddon_list::options_button_callback(twindow& window)
|
||||
{
|
||||
// TODO
|
||||
//gui2::taddon_filter_options dlg;
|
||||
|
||||
//dlg.set_displayed_status(f_.status);
|
||||
//dlg.set_displayed_types(f_.types);
|
||||
//dlg.set_sort(f_.sort);
|
||||
//dlg.set_direction(f_.direction);
|
||||
|
||||
//dlg.show(window.video());
|
||||
}
|
||||
|
||||
void taddon_list::show_help(twindow& window)
|
||||
{
|
||||
help::show_help(window.video(), "installing_addons");
|
||||
}
|
||||
|
||||
void taddon_list::browse_url_callback(ttext_box& url_box)
|
||||
{
|
||||
/* TODO: ask for confirmation */
|
||||
|
|
|
@ -70,6 +70,8 @@ private:
|
|||
|
||||
void browse_url_callback(ttext_box& url_box);
|
||||
void copy_url_callback(ttext_box& url_box);
|
||||
void options_button_callback(twindow& window);
|
||||
void show_help(twindow& window);
|
||||
};
|
||||
|
||||
} // namespace gui2
|
||||
|
|
Loading…
Add table
Reference in a new issue