eepp: Added UIImageViewer new tool widget to view images.

Added a new UIMessageBox event: `Event::OnDiscard`, this will triggered when window is closed without confirmation (`Event::OnConfirm`). And now `Event::OnCancel` is only triggered when is manually cancelled (click the cancel button).
ecode: Greatly improved image viewing experience. Now you can switch images from the same directory with the mouse wheel, also zoom, translate and rotate the images, images open in a new tab by default but quick-preview can be activated in `Settings -> Window -> Quick Preview Images` (SpartanJ/ecode#96).
This commit is contained in:
Martín Lucas Golini
2025-09-28 00:39:17 -03:00
parent 6244563e7d
commit 9d2aec8e14
24 changed files with 736 additions and 65 deletions

View File

@@ -1288,11 +1288,18 @@ UIMenu* SettingsMenu::createWindowMenu() {
mWindowMenu
->addCheckBox( i18n( "use_native_file_dialogs", "Enable Native File Dialogs" ),
mApp->getConfig().ui.nativeFileDialogs )
->setTooltipText(
i18n( "use_native_file_dialogs_tooltip",
"Try to use the OS native file dialogs if they are available." ) )
->setTooltipText( i18n( "use_native_file_dialogs_tooltip",
"Try to use the OS native file dialogs if they are available." ) )
->setId( "native-file-dialogs" );
mWindowMenu
->addCheckBox( i18n( "quick_preview_images", "Quick Preview Images" ),
mApp->getConfig().ui.imagesQuickPreview )
->setTooltipText(
i18n( "quick_preview_images_tooltip",
"Instead of opening a new tab to view an image uses a quick-preview." ) )
->setId( "quick-preview-images" );
mWindowMenu->addSeparator();
mWindowMenu
@@ -1326,6 +1333,10 @@ UIMenu* SettingsMenu::createWindowMenu() {
bool active = item->asType<UIMenuCheckBox>()->isActive();
mApp->getConfig().ui.nativeFileDialogs = active;
mApp->saveConfig();
} else if ( "quick-preview-images" == item->getId() ) {
bool active = item->asType<UIMenuCheckBox>()->isActive();
mApp->getConfig().ui.imagesQuickPreview = active;
mApp->saveConfig();
} else {
String text = String( event->getNode()->asType<UIMenuItem>()->getId() ).toLower();
String::replaceAll( text, " ", "-" );