Skip to content

Commit

Permalink
Reset button functionality for the "Reset" button in the resize windo…
Browse files Browse the repository at this point in the history
…w and translations.
  • Loading branch information
Ruben2776 committed Oct 24, 2024
1 parent 423faef commit 916cfa7
Show file tree
Hide file tree
Showing 16 changed files with 35 additions and 3 deletions.
9 changes: 9 additions & 0 deletions src/PicView.Avalonia/ViewModels/ViewModelBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,19 @@ public void UpdateLanguage()
Percentage = TranslationHelper.Translation.Percentage;
Quality = TranslationHelper.Translation.Quality;
SaveAs = TranslationHelper.Translation.SaveAs;
Reset = TranslationHelper.Translation.Reset;
}

#region Strings

private string? _reset;

public string? Reset
{
get => _reset;
set => this.RaiseAndSetIfChanged(ref _reset, value);
}

private string? _saveAs;

public string? SaveAs
Expand Down
5 changes: 3 additions & 2 deletions src/PicView.Avalonia/Views/SingleImageResizeView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,11 @@
Classes="BorderStyle altHover mainBtn"
CornerRadius="4"
Margin="30,0,60,0"
Width="195">
Width="195"
x:Name="ResetButton">
<TextBlock
Classes="txt"
Text="{CompiledBinding ResetButtonText,
Text="{CompiledBinding Reset,
Mode=OneWay}"
TextAlignment="Center" />
</Button>
Expand Down
8 changes: 8 additions & 0 deletions src/PicView.Avalonia/Views/SingleImageResizeView.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ public SingleImageResizeView()
{
Dispatcher.UIThread.Post(SetIsQualitySliderEnabled);
});

ResetButton.Click += (_, _) =>
{
PixelWidthTextBox.Text = vm.PixelWidth.ToString();
PixelHeightTextBox.Text = vm.PixelHeight.ToString();
QualitySlider.Value = 90;
ConversionComboBox.SelectedItem = NoConversion;
};
};
}

Expand Down
1 change: 1 addition & 0 deletions src/PicView.Core/Config/Languages/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@
"Reload": "Genindlæs",
"RemoveStarRating": "Fjern vurdering",
"RenameFile": "Omdøb fil",
"Reset": "Nulstil",
"ResetButtonText": "Nulstil til standard",
"ResetZoom": "Nulstil zoom",
"Resize": "Ændre størrelse",
Expand Down
1 change: 1 addition & 0 deletions src/PicView.Core/Config/Languages/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@
"Reload": "Neu laden",
"RemoveStarRating": "Bewertung entfernen",
"RenameFile": "Datei umbenennen",
"Reset": "Zurücksetzen",
"ResetButtonText": "Auf Standard zurücksetzen",
"ResetZoom": "Zoom zurücksetzen",
"Resize": "Größe ändern",
Expand Down
1 change: 1 addition & 0 deletions src/PicView.Core/Config/Languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@
"Reload": "Reload",
"RemoveStarRating": "Remove rating",
"RenameFile": "Rename file",
"Reset": "Reset",
"ResetButtonText": "Reset to default",
"ResetZoom": "Reset zoom",
"Resize": "Resize",
Expand Down
3 changes: 2 additions & 1 deletion src/PicView.Core/Config/Languages/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@
"Reload": "Recargar",
"RemoveStarRating": "Eliminar clasificación",
"RenameFile": "Renombrar archivo",
"Reset": "Restablecer",
"ResetButtonText": "Restablecer a predeterminado",
"ResetZoom": "Reset zoom",
"Resize": "Cambiar de tamaño",
Expand Down Expand Up @@ -285,8 +286,8 @@
"ScrollingEnabled": "Rueda del mouse activada",
"SearchSubdirectory": "Buscar subdirectorios",
"SecAbbreviation": "Seg.",
"SelectGalleryThumb": "Seleccionar miniatura de la galería",
"SelectAll": "Seleccionar todo",
"SelectGalleryThumb": "Seleccionar miniatura de la galería",
"SendCurrentImageToRecycleBin": "Enviar imagen actual a papelera de reciclaje",
"SentFileToRecycleBin": "Enviar archivo a papelera de reciclaje",
"SetAs": "Establecer como...",
Expand Down
1 change: 1 addition & 0 deletions src/PicView.Core/Config/Languages/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@
"Reload": "Recharger",
"RemoveStarRating": "Supprimer la note",
"RenameFile": "Renommer le fichier",
"Reset": "Réinitialiser",
"ResetButtonText": "Réinitialiser par défaut",
"ResetZoom": "Réinitialiser le zoom",
"Resize": "Redimensionner",
Expand Down
1 change: 1 addition & 0 deletions src/PicView.Core/Config/Languages/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@
"Reload": "Ricaricare",
"RemoveStarRating": "Rimuovi il rating",
"RenameFile": "Rinomina il file",
"Reset": "Reimposta",
"ResetButtonText": "Reimposta alle impostazioni predefinite",
"ResetZoom": "Ripristina lo zoom",
"Resize": "Ridimensionamento",
Expand Down
1 change: 1 addition & 0 deletions src/PicView.Core/Config/Languages/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@
"Reload": "다시 불러오기",
"RemoveStarRating": "등급 제거",
"RenameFile": "파일 이름 바꾸기",
"Reset": "재설정",
"ResetButtonText": "기본값으로 재설정",
"ResetZoom": "확대/축소 재설정",
"Resize": "크기 조정",
Expand Down
1 change: 1 addition & 0 deletions src/PicView.Core/Config/Languages/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@
"Reload": "Przeładuj",
"RemoveStarRating": "Usuń ocenę",
"RenameFile": "Zmień nazwę",
"Reset": "Zresetuj",
"ResetButtonText": "Przywróć domyślne",
"ResetZoom": "Resetuj zoom",
"Resize": "Zmień rozmiar",
Expand Down
1 change: 1 addition & 0 deletions src/PicView.Core/Config/Languages/ro.json
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@
"Reload": "Reîncărcare",
"RemoveStarRating": "Eliminare evaluare",
"RenameFile": "Redenumire fișier",
"Reset": "Resetează",
"ResetButtonText": "Resetare la implicit",
"ResetZoom": "Resetare transfocare",
"Resize": "Redimensionare",
Expand Down
1 change: 1 addition & 0 deletions src/PicView.Core/Config/Languages/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@
"Reload": "Перезагрузить",
"RemoveStarRating": "Убрать рейтинг",
"RenameFile": "Переименовать файл",
"Reset": "Сбросить",
"ResetButtonText": "Сбросить настройки по умолчанию",
"ResetZoom": "Сбросить масштаб",
"Resize": "Изменить размер",
Expand Down
1 change: 1 addition & 0 deletions src/PicView.Core/Config/Languages/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@
"Reload": "重新载入",
"RemoveStarRating": "移除评分",
"RenameFile": "重命名文件",
"Reset": "重置",
"ResetButtonText": "重置为默认设置",
"ResetZoom": "重设缩放",
"Resize": "调整尺寸",
Expand Down
1 change: 1 addition & 0 deletions src/PicView.Core/Config/Languages/zh-TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@
"Reload": "重新載入",
"RemoveStarRating": "移除評分",
"RenameFile": "重新命名檔案",
"Reset": "重設",
"ResetButtonText": "重置為默認設置",
"ResetZoom": "重設縮放",
"Resize": "調整尺寸",
Expand Down
2 changes: 2 additions & 0 deletions src/PicView.Core/Localization/LanguageModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -381,4 +381,6 @@ public record LanguageModel
public string? SideBySide { get; set; }
public string? SideBySideTooltip { get; set; }
public string? GlassTheme { get; set; }

public string? Reset { get; set; }
}

0 comments on commit 916cfa7

Please sign in to comment.