Skip to content

Commit

Permalink
Fix layer name cell resizing in timeline during gui scaling or theme …
Browse files Browse the repository at this point in the history
…change.
  • Loading branch information
Gasparoken committed Jul 12, 2023
1 parent 90803a3 commit c33e474
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/app/ui/timeline/timeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ Timeline::Timeline(TooltipManager* tooltipManager)
, m_separator_x(
Preferences::instance().general.timelineLayerPanelWidth() * guiscale())
, m_separator_w(1)
, m_oldGuiscale(guiscale())
, m_confPopup(nullptr)
, m_clipboard_timer(100, this)
, m_offset_count(0)
Expand Down Expand Up @@ -1590,6 +1591,12 @@ void Timeline::onInitTheme(ui::InitThemeEvent& ev)
m_hbar.setThumbStyle(theme->styles.transparentScrollbarThumb());
m_vbar.setThumbStyle(theme->styles.transparentScrollbarThumb());

// Resize customizable timeline parts
if (m_oldGuiscale != guiscale()) {
// Width size of the layer name cell
m_separator_x = m_separator_x / m_oldGuiscale * guiscale();
m_oldGuiscale = guiscale();
}
if (m_confPopup)
m_confPopup->initTheme();
}
Expand Down
1 change: 1 addition & 0 deletions src/app/ui/timeline/timeline.h
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ namespace app {

int m_separator_x;
int m_separator_w;
int m_oldGuiscale;
int m_origFrames;
Hit m_hot; // The 'hot' part is where the mouse is on top of
DropTarget m_dropTarget;
Expand Down

0 comments on commit c33e474

Please sign in to comment.