Skip to content

Commit

Permalink
Adding KW_WIDGETHINT_FRAMELESS hint to button
Browse files Browse the repository at this point in the history
  • Loading branch information
mobius3 committed Jul 9, 2014
1 parent 8f2323d commit f865b75
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/KW_button.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ void PaintButton(KW_Widget * widget) {
KW_Button * button = KW_GetWidgetData(widget, KW_WIDGETTYPE_BUTTON);
SDL_Rect targetgeom;
SDL_Renderer * renderer = KW_GetWidgetRenderer(widget);
/* don't draw frame if requested. */
if (KW_QueryWidgetHint(widget, KW_WIDGETHINT_FRAMELESS) == SDL_TRUE)
return;

KW_GetWidgetAbsoluteGeometry(widget, &targetgeom);
if (button->mouseover)
SDL_RenderCopy(renderer, button->normal, NULL, &targetgeom);
Expand Down
6 changes: 5 additions & 1 deletion src/KW_widget.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,11 @@ typedef enum KW_WidgetHint {

/** Makes KiWi avoid reporting input event to this widget but still passes to
* its children widgets */
KW_WIDGETHINT_IGNOREINPUTEVENTS = 1 << 2
KW_WIDGETHINT_IGNOREINPUTEVENTS = 1 << 2,

/** Hints widget implementations that, if possible, the user wants a
* frameless version of it */
KW_WIDGETHINT_FRAMELESS = 1 << 3
} KW_WidgetHint;

/**
Expand Down

0 comments on commit f865b75

Please sign in to comment.