More window chrome improvements

This commit is contained in:
elasota
2020-05-18 02:03:17 -04:00
parent f590613f83
commit ea16d0ffca
41 changed files with 804 additions and 429 deletions

View File

@@ -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;
};
}