fix: grey out the charmap Copy button while showing "Copied"
Render the button in its disabled state during the post-copy confirmation window, matching the Bluetooth app's greyed-out "Scanning..." button. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -421,9 +421,10 @@ static void render(Canvas& c) {
|
|||||||
meta, g_theme.text_subtle, META_SIZE);
|
meta, g_theme.text_subtle, META_SIZE);
|
||||||
|
|
||||||
// Copy button — canonical MTK primary button, like other Montauk apps.
|
// Copy button — canonical MTK primary button, like other Montauk apps.
|
||||||
// Its label flips to "Copied" for a moment after a copy as confirmation.
|
// After a copy it flips to a greyed-out "Copied" for a moment (the disabled
|
||||||
|
// state, matching the Bluetooth app's "Scanning..." button) as confirmation.
|
||||||
bool just_copied = g_copied_until && montauk::get_milliseconds() < g_copied_until;
|
bool just_copied = g_copied_until && montauk::get_milliseconds() < g_copied_until;
|
||||||
mtk::WidgetState copy_state = mtk::widget_state(false, g_copy_hover, true);
|
mtk::WidgetState copy_state = mtk::widget_state(false, g_copy_hover, !just_copied);
|
||||||
mtk::draw_button(c, L.copy_btn, just_copied ? "Copied" : "Copy",
|
mtk::draw_button(c, L.copy_btn, just_copied ? "Copied" : "Copy",
|
||||||
mtk::BUTTON_PRIMARY, copy_state, g_theme);
|
mtk::BUTTON_PRIMARY, copy_state, g_theme);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user