mirror of
https://repo.dec05eba.com/gpu-screen-recorder-ui
synced 2026-03-31 09:17:04 +09:00
Make scrollbar movable with mouse, limit filechooser content to inside of file item
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
#include "../SafeVector.hpp"
|
||||
#include <memory>
|
||||
|
||||
#include <mglpp/system/FloatRect.hpp>
|
||||
|
||||
namespace gsr {
|
||||
class ScrollablePage : public Widget {
|
||||
public:
|
||||
@@ -15,15 +17,22 @@ namespace gsr {
|
||||
void draw(mgl::Window &window, mgl::vec2f offset) override;
|
||||
|
||||
mgl::vec2f get_size() override;
|
||||
mgl::vec2f get_inner_size() override;
|
||||
void set_size(mgl::vec2f size);
|
||||
|
||||
void add_widget(std::unique_ptr<Widget> widget);
|
||||
|
||||
void reset_scroll();
|
||||
private:
|
||||
float get_scrollbar_width() const;
|
||||
private:
|
||||
mgl::vec2f size;
|
||||
SafeVector<std::unique_ptr<Widget>> widgets;
|
||||
int scroll_target_y = 0;
|
||||
double scroll_y = 0.0;
|
||||
mgl::FloatRect scrollbar_rect;
|
||||
bool moving_scrollbar_with_cursor = false;
|
||||
mgl::vec2f scrollbar_move_cursor_start_pos;
|
||||
double scrollbar_move_cursor_scroll_y_start = 0.0;
|
||||
};
|
||||
}
|
||||
@@ -57,7 +57,6 @@ namespace gsr {
|
||||
std::unique_ptr<List> create_video_codec(const GsrInfo &gsr_info);
|
||||
std::unique_ptr<ComboBox> create_audio_codec_box();
|
||||
std::unique_ptr<List> create_audio_codec();
|
||||
std::unique_ptr<List> create_codec_section(const GsrInfo &gsr_info);
|
||||
std::unique_ptr<Entry> create_framerate_entry();
|
||||
std::unique_ptr<List> create_framerate();
|
||||
std::unique_ptr<ComboBox> create_framerate_mode_box();
|
||||
@@ -101,7 +100,8 @@ namespace gsr {
|
||||
List *area_size_list_ptr = nullptr;
|
||||
List *restore_portal_session_list_ptr = nullptr;
|
||||
List *color_range_list_ptr = nullptr;
|
||||
List *codec_list_ptr = nullptr;
|
||||
Widget *video_codec_ptr = nullptr;
|
||||
Widget *audio_codec_ptr = nullptr;
|
||||
List *framerate_mode_list_ptr = nullptr;
|
||||
ComboBox *record_area_box_ptr = nullptr;
|
||||
Entry *area_width_entry_ptr = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user