Skip to content

Commit 155914a

Browse files
committed
tool: prefs: update "Output filename format" example text only when edited
1 parent 637278f commit 155914a

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/clipboard.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Result<int> start_linux_copy(SessionType session, const std::string_view mime_ty
6666

6767
return Ok(copy_pipe[1]);
6868
#else
69-
return Err("wl-copy scheme is not supported on non-linux systems!");
69+
return Err("wl-copy/xclip scheme is not supported on non-linux systems!");
7070
#endif
7171
}
7272

src/screenshot_tool.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,6 +1507,7 @@ void ScreenshotTool::DrawAnnotationToolbar()
15071507
static void draw_preference_edit_config(const std::function<void()>& refresh_models_func, bool window_just_opened)
15081508
{
15091509
static std::string new_font;
1510+
static Result<std::string> r = get_config_image_out_fmt();
15101511

15111512
ImGui::SeparatorText("Edit default config");
15121513
ImGui::Spacing();
@@ -1597,8 +1598,9 @@ static void draw_preference_edit_config(const std::function<void()>& refresh_mod
15971598
HelpMarker("The .png extension is appended automatically. Uses {fmt} chrono specifiers.");
15981599
ImGui::Spacing();
15991600

1600-
ImGui::InputText("##config_image_out_fmt", &g_config->File.image_out_fmt);
1601-
const Result<std::string>& r = get_config_image_out_fmt();
1601+
if (ImGui::InputText("##config_image_out_fmt", &g_config->File.image_out_fmt))
1602+
r = get_config_image_out_fmt();
1603+
16021604
if (!r.ok())
16031605
ImGui::TextColored(ImVec4(1, 0, 0, 1), "%s", r.error_v().c_str());
16041606
else

0 commit comments

Comments
 (0)