mirror of
https://repo.dec05eba.com/gpu-screen-recorder-ui
synced 2026-03-31 09:17:04 +09:00
Smaller screenshot icon
This commit is contained in:
@@ -21,6 +21,7 @@ namespace gsr {
|
||||
|
||||
mgl::vec2f get_size() override;
|
||||
void set_border_scale(float scale);
|
||||
void set_icon_padding_scale(float scale);
|
||||
void set_bg_hover_color(mgl::Color color);
|
||||
void set_icon(mgl::Texture *texture);
|
||||
|
||||
@@ -38,5 +39,6 @@ namespace gsr {
|
||||
mgl::Text text;
|
||||
mgl::Sprite sprite;
|
||||
float border_scale = 0.0015f;
|
||||
float icon_padding_scale = 1.0f;
|
||||
};
|
||||
}
|
||||
@@ -1156,6 +1156,7 @@ namespace gsr {
|
||||
button->set_position((main_buttons_list_ptr->get_position() + main_buttons_size - mgl::vec2f(0.0f, settings_button_size*2) + mgl::vec2f(settings_button_size * 0.333f, 0.0f)).floor());
|
||||
button->set_bg_hover_color(mgl::Color(0, 0, 0, 255));
|
||||
button->set_icon(&get_theme().screenshot_texture);
|
||||
button->set_icon_padding_scale(1.2f);
|
||||
button->on_click = [&]() {
|
||||
auto screenshot_settings_page = std::make_unique<ScreenshotSettingsPage>(&gsr_info, config, &page_stack);
|
||||
page_stack.push(std::move(screenshot_settings_page));
|
||||
|
||||
@@ -105,6 +105,10 @@ namespace gsr {
|
||||
border_scale = scale;
|
||||
}
|
||||
|
||||
void Button::set_icon_padding_scale(float scale) {
|
||||
icon_padding_scale = scale;
|
||||
}
|
||||
|
||||
void Button::set_bg_hover_color(mgl::Color color) {
|
||||
bg_hover_color = color;
|
||||
}
|
||||
@@ -127,8 +131,8 @@ namespace gsr {
|
||||
|
||||
const float widget_height = get_button_height();
|
||||
|
||||
const int padding_icon_top = padding_top_icon_scale * widget_height;
|
||||
const int padding_icon_bottom = padding_bottom_icon_scale * widget_height;
|
||||
const int padding_icon_top = padding_top_icon_scale * icon_padding_scale * widget_height;
|
||||
const int padding_icon_bottom = padding_bottom_icon_scale * icon_padding_scale * widget_height;
|
||||
|
||||
const float desired_height = widget_height - (padding_icon_top + padding_icon_bottom);
|
||||
sprite.set_height((int)desired_height);
|
||||
|
||||
Reference in New Issue
Block a user