Skip to content

Commit

Permalink
picker
Browse files Browse the repository at this point in the history
- process URL with pipeline before showing picker
- added window title instead of custom close button
  • Loading branch information
aloneguid committed Jul 5, 2024
1 parent f6bc89a commit 0bba6c2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
21 changes: 11 additions & 10 deletions bt/app/ui/picker_app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,17 @@ namespace w = grey::widgets;

namespace bt::ui {
picker_app::picker_app(const string& url, std::vector<std::shared_ptr<bt::browser_instance>> choices)
: url{url}, choices{choices}, title{"Pick"},
: url{url}, choices{choices}, title{APP_LONG_NAME " - Pick"},
app{grey::app::make(title)}, wnd_main{ title, &is_open } {
app->initial_theme_id = g_config.theme_id;
app->load_icon_font = false;

// process URL with pipeline
{
url_payload up{url};
g_pipeline.process(up);
this->url = up.open_url;
}

// get unique list of browsers
for(auto& c : choices) {
Expand Down Expand Up @@ -57,15 +65,15 @@ namespace bt::ui {
style.WindowPadding.y * 2 / app->scale +
BrowserSquareSize +
//ProfileSquareSize +
25;
45;
wnd_height_profiles = wnd_height_normal + ProfileSquareSize;

// calculate lef pad so browsers look centered
browser_bar_left_pad = (wnd_width - (BrowserSquareSize * browsers.size())) / 2 * app->scale;

wnd_main
.size(wnd_width, wnd_height_normal)
.no_titlebar()
//.no_titlebar()
.no_resize()
//.no_border()
.no_scroll()
Expand Down Expand Up @@ -106,13 +114,6 @@ namespace bt::ui {

w::guard gw{wnd_main};

if(w::button(ICON_MD_CLOSE, w::emphasis::none, true, true)) {
make_decision(nullptr);
}
w::tooltip("Cancel and do nothing");
w::sl();
w::button(ICON_MD_SETTINGS, w::emphasis::none, true, true);

// URL editor
ImGui::PushItemWidth(-1);
w::sl();
Expand Down
2 changes: 1 addition & 1 deletion grey
Submodule grey updated 2 files
+1 −1 grey/app.cpp
+7 −0 grey/app.h

0 comments on commit 0bba6c2

Please sign in to comment.