Advertisement
Guest User

Untitled

a guest
Dec 24th, 2011
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.17 KB | None | 0 0
  1. diff --git a/src/client/ui/node/ui_node_spinner.c b/src/client/ui/node/ui_node_s
  2. index d67ba5a..2148cfa 100644
  3. --- a/src/client/ui/node/ui_node_spinner.c
  4. +++ b/src/client/ui/node/ui_node_spinner.c
  5. @@ -43,8 +43,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 021
  6. static const uiBehaviour_t const *localBehaviour;
  7.  
  8. static const int TILE_SIZE = 32;
  9. -static const int SPINNER_WIDTH = 15;
  10. -static const int SPINNER_HEIGHT = 19;
  11. +static int SPINNER_WIDTH = 15;
  12. +static int SPINNER_HEIGHT = 19;
  13. static const int BUTTON_TOP_SIZE = 9;
  14. static const int BUTTON_BOTTOM_SIZE = 10;
  15.  
  16. @@ -182,6 +182,13 @@ static void UI_SpinnerNodeDraw (uiNode_t *node)
  17.  
  18. UI_GetNodeAbsPos(node, pos);
  19.  
  20. + if (EXTRADATACONST(node).width) {
  21. + SPINNER_WIDTH = EXTRADATACONST(node).width;
  22. + }
  23. + if (EXTRADATACONST(node).height) {
  24. + SPINNER_HEIGHT = EXTRADATACONST(node).height;
  25. + }
  26. +
  27. if (disabled || delta == 0) {
  28. topTexX = TILE_SIZE;
  29. topTexY = TILE_SIZE;
  30. @@ -247,6 +254,14 @@ static const value_t properties[] = {
  31. * @brief Defines a factor that is applied to the delta value when the s
  32. */
  33. {"shiftincreasefactor", V_FLOAT, UI_EXTRADATA_OFFSETOF(spinnerExtraData_
  34. + /**
  35. + * Width of the spinner
  36. + */
  37. + {"width", V_FLOAT, UI_EXTRADATA_OFFSETOF(spinnerExtraData_t, width), MEM
  38. + /**
  39. + * Height of the spinner
  40. + */
  41. + {"height", V_FLOAT, UI_EXTRADATA_OFFSETOF(spinnerExtraData_t, height), M
  42.  
  43. {NULL, V_NULL, 0, 0}
  44. };
  45. diff --git a/src/client/ui/node/ui_node_spinner.h b/src/client/ui/node/ui_node_s
  46. index b4500a4..c808a5f 100644
  47. --- a/src/client/ui/node/ui_node_spinner.h
  48. +++ b/src/client/ui/node/ui_node_spinner.h
  49. @@ -31,6 +31,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 021
  50. typedef struct spinnerExtraData_s {
  51. abstractValueExtraData_t super;
  52. float shiftIncreaseFactor;
  53. + float width; /**< Optional width of the button */
  54. + float height; /**< Optional height of the button */
  55. } spinnerExtraData_t;
  56.  
  57. void UI_RegisterSpinnerNode(uiBehaviour_t *behaviour);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement