Skip to content

Commit

Permalink
Properly resize subtitle grid on DPI change
Browse files Browse the repository at this point in the history
  • Loading branch information
arch1t3cht committed Feb 2, 2025
1 parent 8216594 commit 97ba1e4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/base_grid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,14 @@ BEGIN_EVENT_TABLE(BaseGrid,wxWindow)
EVT_KEY_DOWN(BaseGrid::OnKeyDown)
EVT_CHAR_HOOK(BaseGrid::OnCharHook)
EVT_MENU_RANGE(MENU_SHOW_COL,MENU_SHOW_COL+15,BaseGrid::OnShowColMenu)
EVT_DPI_CHANGED(BaseGrid::OnDPIChanged)
END_EVENT_TABLE()

void BaseGrid::OnDPIChanged(wxDPIChangedEvent &e) {
UpdateStyle();
e.Skip();
}

void BaseGrid::OnSubtitlesCommit(int type) {
if (type == AssFile::COMMIT_NEW || type & AssFile::COMMIT_ORDER || type & AssFile::COMMIT_DIAG_ADDREM)
UpdateMaps();
Expand Down
1 change: 1 addition & 0 deletions src/base_grid.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ class BaseGrid final : public wxWindow {
/// Cached grid body context menu
std::unique_ptr<wxMenu> context_menu;

void OnDPIChanged(wxDPIChangedEvent &e);
void OnContextMenu(wxContextMenuEvent &evt);
void OnHighlightVisibleChange(agi::OptionValue const& opt);
void OnKeyDown(wxKeyEvent &event);
Expand Down

0 comments on commit 97ba1e4

Please sign in to comment.