Skip to content
This repository has been archived by the owner on Dec 31, 2022. It is now read-only.

Commit

Permalink
added getter for Style.ItemInnerSpacing
Browse files Browse the repository at this point in the history
  • Loading branch information
dertseha committed Aug 4, 2018
1 parent 6a84c33 commit 4a076f5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Style.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,16 @@ func (style Style) handle() C.IggGuiStyle {
return C.IggGuiStyle(style)
}

// ItemInnerSpacing is the horizontal and vertical spacing between elements of
// a composed widget (e.g. a slider and its label).
func (style Style) ItemInnerSpacing() Vec2 {
var value Vec2
valueArg, valueFin := value.wrapped()
C.iggStyleGetItemInnerSpacing(style.handle(), valueArg)
valueFin()
return value
}

// SetColor sets a color value of the UI style.
func (style Style) SetColor(id StyleColorID, value Vec4) {
valueArg, _ := value.wrapped()
Expand Down
6 changes: 6 additions & 0 deletions StyleWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
#include "StyleWrapper.h"
#include "WrapperConverter.h"

void iggStyleGetItemInnerSpacing(IggGuiStyle handle, IggVec2 *value)
{
ImGuiStyle *style = reinterpret_cast<ImGuiStyle *>(handle);
exportValue(*value, style->ItemInnerSpacing);
}

void iggStyleSetColor(IggGuiStyle handle, int colorID, IggVec4 const *value)
{
ImGuiStyle *style = reinterpret_cast<ImGuiStyle *>(handle);
Expand Down
2 changes: 2 additions & 0 deletions StyleWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ extern "C"
{
#endif

extern void iggStyleGetItemInnerSpacing(IggGuiStyle handle, IggVec2 *value);

extern void iggStyleSetColor(IggGuiStyle handle, int index, IggVec4 const *color);

extern void iggStyleScaleAllSizes(IggGuiStyle handle, float scale);
Expand Down

0 comments on commit 4a076f5

Please sign in to comment.