Skip to content

Commit

Permalink
fix surge-synthesizer#544 Inactive buttons [Linux] (surge-synthesizer…
Browse files Browse the repository at this point in the history
…#588)

Solo, Mute, and other CSwitchControl buttons were inactive on Linux because CScalableBitmap returns size 0,0 for all bitmaps on Linux. This diff doesn't solve that problem but accommodates it by making CSwitchControl work like the other switch controls; using a constructor specified size (in this case the size of the view rectangle) to determine how much to translate the switching image. This makes solo, mute, and others work on Linux.

Closes surge-synthesizer#544 by making those buttons inactive.

Former-commit-id: a2a858c26719c32a55904661ee9b7ca12eefdc66 [formerly 40e18d1]
Former-commit-id: 40ef5151482e5843a0503ce5d2fb87d0a0d19eaa
Former-commit-id: df1b0bc9beb018eb159d39e1000c085d465c2378
  • Loading branch information
rghvdberg authored and baconpaul committed Feb 12, 2019
1 parent 4b90893 commit 84b7b11
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/common/gui/CSwitchControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ CSwitchControl::CSwitchControl(const CRect& size,
{
down = false;
is_itype = false;
}
heightOfSingleImage = size.getHeight();
}

void CSwitchControl::draw(CDrawContext* dc)
{
Expand All @@ -26,7 +27,7 @@ void CSwitchControl::draw(CDrawContext* dc)
}
else
{
CPoint where(0, (down ? (pBackground->getHeight() / 2) : 0));
CPoint where(0, (down ? heightOfSingleImage : 0));
pBackground->draw(dc, size, where, 0xff);
}
}
Expand Down
1 change: 1 addition & 0 deletions src/common/gui/CSwitchControl.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class CSwitchControl : public VSTGUI::CControl

private:
bool down;
float heightOfSingleImage;

CLASS_METHODS(CSwitchControl, VSTGUI::CControl)
};

0 comments on commit 84b7b11

Please sign in to comment.