Skip to content

Commit

Permalink
Fixed editbox text editor bad font size when screen DPI has changed
Browse files Browse the repository at this point in the history
Fixed font dialog font reset
Update English translation
  • Loading branch information
bjakja committed Jul 31, 2021
1 parent b02fb5d commit cac5c59
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 36 deletions.
2 changes: 1 addition & 1 deletion Kaiplayer/EditBox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,6 @@ void EditBox::OnFontClick(wxCommandEvent& event)
{
char form = grid->subsFormat;
Styles *mstyle = (form < SRT) ? grid->GetStyle(0, line->Style)->Copy() : new Styles();
actualStyle = Styles(*mstyle);
int tmpIter = grid->file->Iter();
if (form < SRT){
wxString tmp;
Expand Down Expand Up @@ -741,6 +740,7 @@ void EditBox::OnFontClick(wxCommandEvent& event)
mstyle->Fontname = tmp;
}
}
actualStyle = Styles(*mstyle);
FontDialog *FD = FontDialog::Get(this, mstyle);
FD->Bind(FONT_CHANGED, &EditBox::OnFontChange, this, FD->GetId());
if (FD->ShowModal() == wxID_OK) {
Expand Down
6 changes: 4 additions & 2 deletions Kaiplayer/MyTextEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2883,8 +2883,10 @@ void TextEditor::SetState(int _state, bool refresh){

bool TextEditor::SetFont(const wxFont &_font)
{
wxWindow::SetFont(_font);
font = _font;
int fontSize = Options.GetInt(TEXT_EDITOR_FONT_SIZE);
font = wxFont(*Options.GetFont(fontSize - 10));
wxWindow::SetFont(font);

int fw, fh;
GetTextExtent(L"#TWFfGH", &fw, &fh, NULL, NULL, &font);
fontHeight = fh;
Expand Down
4 changes: 2 additions & 2 deletions Kaiplayer/VersionKainote.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
//StableReleaseLink: https://github.com/bjakja/Kainote/releases/download/v0.9.3.893/Kainote.x64.zip
//VersionKainoteX86: 0.9.3.910

#define VersionKainote "0.9.9.1395"
#define NumVersionKainote 0,9,9,1395
#define VersionKainote "0.9.9.1397"
#define NumVersionKainote 0,9,9,1397
2 changes: 1 addition & 1 deletion Kaiplayer/VideoToolbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ VideoToolbar::VideoToolbar(wxWindow *parent, const wxPoint &pos, const wxSize &s
icons.push_back(new itemdata(PTR_BITMAP_PNG(L"SUBSRESAMPLE"), _("Utrzymanie proporcji, by po skalowaniu rysunki wektorowe i tekst\nnie poprzestawiały się względem siebie.")));
//7
//icons position
icons.push_back(new itemdata(PTR_BITMAP_PNG(L"FRAME_TO_SCALE"), _("Ustaw pozycję według prostokąta.\nPo narysowaniu prostokąta tekst zostanie\nspozycjonowany wg jednej osi badź dwóch\ndla wybranego położenia")));
icons.push_back(new itemdata(PTR_BITMAP_PNG(L"FRAME_TO_SCALE"), _("Ustaw pozycję według prostokąta.\nPo narysowaniu prostokąta tekst zostanie\nspozycjonowany wg jednej osi badź dwóch\ndla wybranego położenia.")));
icons.push_back(new itemdata(PTR_BITMAP_PNG(L"SCALE_X"), _("Pozycjonuj w osi X")));
icons.push_back(new itemdata(PTR_BITMAP_PNG(L"SCALE_Y"), _("Pozycjonuj w osi Y")));
//3
Expand Down
19 changes: 18 additions & 1 deletion Kaiplayer/VisualClips.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,23 @@ void DrawingAndClip::SetClip(bool dummy, bool redraw, bool changeEditorText)
}
return;
}

if (clip == L"" && Visual == VECTORCLIP) {
wxString txt = editor->GetValue();
clipMask.Empty();
if (FindTag(L"(i?clip\\(.*m[^)]*)\\)", txt, 1)) {
Replace(L"", &txt);
txt.Replace(L"{}", L"");
if (changeEditorText) {
editor->SetTextS(txt, false, true);
editor->SetModified();
edit->Send(VISUAL_VECTOR_CLIP, false);
}
return;
}
tab->Video->SetVisualEdition(false);
RenderSubs(tab->Grid->GetVisible(), redraw);
return;
}
if (dummy) {

if (!dummytext) {
Expand Down Expand Up @@ -513,6 +529,7 @@ void DrawingAndClip::ChangeVectorVisual(wxString *txt, wxString *clip, wxPoint*
//not used cause it can be along with vector clip in one line
bool fv = FindTag(L"(i?clip\\(.*m[^)]*)\\)", *txt, 1);
GetTextResult(&tmp);
//probably not used, but better to leave it as is to avoid some rare cases.
if (clip->empty() && fv) {
Replace(L"", txt);
txt->Replace(L"{}", L"");
Expand Down
Binary file modified Locale/en.mo
Binary file not shown.
62 changes: 33 additions & 29 deletions Locale/en.po
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: 2021-07-23 18:23+0200\n"
"PO-Revision-Date: 2021-07-23 19:54+0200\n"
"POT-Creation-Date: 2021-07-31 13:37+0200\n"
"PO-Revision-Date: 2021-07-31 13:41+0200\n"
"Last-Translator: Marcin Drob <[email protected]>\n"
"Language-Team: \n"
"Language: en\n"
Expand Down Expand Up @@ -584,7 +584,7 @@ msgstr ""
#: Hotkeys.cpp:470 Hotkeys.cpp:480 OptionsDialog.cpp:108 OptionsDialog.cpp:117
#: OptionsDialog.cpp:465 SpellCheckerDialog.cpp:139 SubsGrid.cpp:1078
#: SubsGridBase.cpp:519 SubsGridBase.cpp:548 Videobox.cpp:287
#: VisualClips.cpp:1036 kainoteApp.cpp:156 kainoteApp.cpp:200
#: VisualClips.cpp:1053 kainoteApp.cpp:156 kainoteApp.cpp:200
#: kainoteMain.cpp:953 kainoteMain.cpp:969 kainoteMain.cpp:1076
msgid "Uwaga"
msgstr "Warning"
Expand Down Expand Up @@ -6328,7 +6328,7 @@ msgid ""
"Ustaw pozycję według prostokąta.\n"
"Po narysowaniu prostokąta tekst zostanie\n"
"spozycjonowany wg jednej osi badź dwóch\n"
"dla wybranego położenia"
"dla wybranego położenia."
msgstr ""
"Set position by rectangle.\n"
"After draw a rectangle line will be positioned\n"
Expand Down Expand Up @@ -6456,91 +6456,91 @@ msgstr ""
msgid "Edycja tagów z listy oraz tworzenie nowych"
msgstr "Edition list tags or adding a new tags"

#: VideoToolbar.cpp:1066
#: VideoToolbar.cpp:1074
msgid "Lewo-dół"
msgstr "Left-bottom"

#: VideoToolbar.cpp:1066
#: VideoToolbar.cpp:1074
msgid "Środek-dół"
msgstr "Center-bottom"

#: VideoToolbar.cpp:1066
#: VideoToolbar.cpp:1074
msgid "Prawo-dół"
msgstr "Right-bottom"

#: VideoToolbar.cpp:1067
#: VideoToolbar.cpp:1075
msgid "Lewo-środek"
msgstr "Left-center"

#: VideoToolbar.cpp:1067
#: VideoToolbar.cpp:1075
msgid "Środek"
msgstr "Center"

#: VideoToolbar.cpp:1067
#: VideoToolbar.cpp:1075
msgid "Prawo-środek"
msgstr "Right-center"

#: VideoToolbar.cpp:1068
#: VideoToolbar.cpp:1076
msgid "Lewo-góra"
msgstr "Left-top"

#: VideoToolbar.cpp:1068
#: VideoToolbar.cpp:1076
msgid "Środek-góra"
msgstr "Center-top"

#: VideoToolbar.cpp:1068
#: VideoToolbar.cpp:1076
msgid "Prawo-góra"
msgstr "Right-top"

#: VideoToolbar.cpp:1070
#: VideoToolbar.cpp:1078
msgid "Lewo-poniżej"
msgstr "Left-below"

#: VideoToolbar.cpp:1070
#: VideoToolbar.cpp:1078
msgid "Środek-poniżej"
msgstr "Center-below"

#: VideoToolbar.cpp:1070
#: VideoToolbar.cpp:1078
msgid "Prawo-poniżej"
msgstr "Right-below"

#: VideoToolbar.cpp:1071
#: VideoToolbar.cpp:1079
msgid "Lewo-ponad"
msgstr "Left-above"

#: VideoToolbar.cpp:1071
#: VideoToolbar.cpp:1079
msgid "Środek-ponad"
msgstr "Center-above"

#: VideoToolbar.cpp:1071
#: VideoToolbar.cpp:1079
msgid "Prawo-ponad"
msgstr "Right-above"

#: VideoToolbar.cpp:1072
#: VideoToolbar.cpp:1080
msgid "Przed-góra"
msgstr "Before-top"

#: VideoToolbar.cpp:1072
#: VideoToolbar.cpp:1080
msgid "Przed-środek"
msgstr "Before-center"

#: VideoToolbar.cpp:1072
#: VideoToolbar.cpp:1080
msgid "Przed-dół"
msgstr "Before-bottom"

#: VideoToolbar.cpp:1073
#: VideoToolbar.cpp:1081
msgid "Za-góra"
msgstr "After-top"

#: VideoToolbar.cpp:1073
#: VideoToolbar.cpp:1081
msgid "Za-środek"
msgstr "After-center"

#: VideoToolbar.cpp:1073
#: VideoToolbar.cpp:1081
msgid "Za-dół"
msgstr "After-bottom"

#: VideoToolbar.cpp:1082
#: VideoToolbar.cpp:1090
msgid "Położenie tekstu, działa podobnie jak w stylach"
msgstr "Text placing works similar like in styles"

Expand Down Expand Up @@ -6742,7 +6742,7 @@ msgstr ""
msgid "Pole \"Przeskok\" zawiera liczbę zbyt wysoką dla danego przedziału."
msgstr "Field \"Step\" contains number too great for current min - max range."

#: VisualClips.cpp:1035
#: VisualClips.cpp:1052
msgid ""
"Ze względu na błędy Vsfiltra możliwość wstawiania dwóch \"m\" po sobie "
"została zablokowana"
Expand Down Expand Up @@ -6786,7 +6786,7 @@ msgstr "Scale changing"

#: VisualDrawingShapes.cpp:76
msgid "Skalowanie względem kursora:"
msgstr "Scaling via cursor"
msgstr "Scaling via cursor:"

#: VisualDrawingShapes.cpp:78
msgid "Rodzaj skalowania:"
Expand Down Expand Up @@ -6830,7 +6830,11 @@ msgid ""
"Wideo musi być ustawione minimum jedną klatkę po czasie początkowym linijki"
msgstr "Video must be set at least one frame after start time of line"

#: VisualRotationZ.cpp:477 VisualScale.cpp:752
#: VisualRotationZ.cpp:477
msgid "Nie można pobrać wartości clipa prostokątnego."
msgstr "Cannot read clip rectangle values."

#: VisualScale.cpp:752
msgid "Nie mona pobra wartoci clipa prostoktnego."
msgstr "Cannot get content of font \"%s\"."

Expand Down

0 comments on commit cac5c59

Please sign in to comment.