mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-09-23 06:53:43 +00:00
More window chrome improvements
This commit is contained in:
@@ -8,18 +8,32 @@ namespace PortabilityLayer
|
||||
class ButtonWidget final : public WidgetSpec<ButtonWidget>
|
||||
{
|
||||
public:
|
||||
enum ButtonStyle
|
||||
{
|
||||
kButtonStyle_Button,
|
||||
kButtonStyle_CheckBox,
|
||||
kButtonStyle_Radio,
|
||||
};
|
||||
|
||||
struct AdditionalData
|
||||
{
|
||||
AdditionalData();
|
||||
|
||||
ButtonStyle m_buttonStyle;
|
||||
};
|
||||
|
||||
explicit ButtonWidget(const WidgetBasicState &state);
|
||||
|
||||
bool Init(const WidgetBasicState &state) override;
|
||||
|
||||
bool Init(const WidgetBasicState &state, const void *additionalData) override;
|
||||
void DrawControl(DrawSurface *surface) override;
|
||||
|
||||
void SetString(const PLPasStr &str) override;
|
||||
PLPasStr GetString() const override;
|
||||
|
||||
WidgetHandleState_t ProcessEvent(const TimeTaggedVOSEvent &evt) override;
|
||||
|
||||
void OnEnabledChanged() override;
|
||||
|
||||
void OnStateChanged() override;
|
||||
int16_t Capture(const Point &pos, WidgetUpdateCallback_t callback) override;
|
||||
|
||||
void SetHighlightStyle(int16_t style, bool enabled) override;
|
||||
|
||||
static void DrawDefaultButtonChrome(const Rect &rect, DrawSurface *surface);
|
||||
@@ -27,7 +41,12 @@ namespace PortabilityLayer
|
||||
private:
|
||||
void DrawControlInternal(DrawSurface *surface, bool inverted);
|
||||
|
||||
void DrawAsButton(DrawSurface *surface, bool inverted);
|
||||
void DrawAsRadio(DrawSurface *surface, bool inverted);
|
||||
void DrawAsCheck(DrawSurface *surface, bool inverted);
|
||||
|
||||
PascalStr<255> m_text;
|
||||
ButtonStyle m_buttonStyle;
|
||||
bool m_haveHighlightOverride;
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user