Added setup_mini_look() function.

This commit is contained in:
David Capello 2010-03-21 23:18:30 -03:00
parent 9031c48773
commit 3f1cad8505
4 changed files with 13 additions and 15 deletions

View File

@ -21,14 +21,12 @@
#include <allegro/unicode.h> #include <allegro/unicode.h>
#include "jinete/jinete.h" #include "jinete/jinete.h"
#include "Vaca/SharedPtr.h"
#include "commands/command.h" #include "commands/command.h"
#include "sprite_wrappers.h" #include "sprite_wrappers.h"
#include "app.h" #include "app.h"
#include "core/core.h" #include "core/core.h"
#include "modules/gui.h" #include "modules/gui.h"
#include "modules/skinneable_theme.h"
#include "raster/cel.h" #include "raster/cel.h"
#include "raster/image.h" #include "raster/image.h"
#include "raster/layer.h" #include "raster/layer.h"
@ -87,9 +85,7 @@ void CelPropertiesCommand::execute(Context* context)
"ok", &button_ok, NULL); "ok", &button_ok, NULL);
// Mini look for the opacity slider // Mini look for the opacity slider
Vaca::SharedPtr<SkinProperty> skinProp(new SkinProperty); setup_mini_look(slider_opacity);
skinProp->setMiniLook(true);
slider_opacity->setProperty(skinProp);
/* if the layer isn't writable */ /* if the layer isn't writable */
if (!layer->is_writable()) { if (!layer->is_writable()) {

View File

@ -31,6 +31,7 @@
#include "jinete/jinete.h" #include "jinete/jinete.h"
#include "jinete/jintern.h" #include "jinete/jintern.h"
#include "Vaca/SharedPtr.h"
#include "commands/command.h" #include "commands/command.h"
#include "commands/commands.h" #include "commands/commands.h"
@ -773,6 +774,13 @@ void get_widgets(JWidget window, ...)
va_end(ap); va_end(ap);
} }
void setup_mini_look(Widget* widget)
{
Vaca::SharedPtr<SkinProperty> skinProp(new SkinProperty);
skinProp->setMiniLook(true);
widget->setProperty(skinProp);
}
/**********************************************************************/ /**********************************************************************/
/* Icon in buttons */ /* Icon in buttons */

View File

@ -88,6 +88,8 @@ void hook_signal(Widget* widget,
void get_widgets(Widget* window, ...); void get_widgets(Widget* window, ...);
void setup_mini_look(Widget* widget);
void add_gfxicon_to_button(Widget* button, int gfx_id, int icon_align); void add_gfxicon_to_button(Widget* button, int gfx_id, int icon_align);
void set_gfxicon_in_button(Widget* button, int gfx_id); void set_gfxicon_in_button(Widget* button, int gfx_id);

View File

@ -24,7 +24,6 @@
#include <string.h> #include <string.h>
#include "Vaca/Bind.h" #include "Vaca/Bind.h"
#include "Vaca/SharedPtr.h"
#include "jinete/jinete.h" #include "jinete/jinete.h"
#include "app.h" #include "app.h"
@ -34,7 +33,6 @@
#include "modules/gfx.h" #include "modules/gfx.h"
#include "modules/gui.h" #include "modules/gui.h"
#include "modules/palettes.h" #include "modules/palettes.h"
#include "modules/skinneable_theme.h"
#include "raster/cel.h" #include "raster/cel.h"
#include "raster/layer.h" #include "raster/layer.h"
#include "raster/sprite.h" #include "raster/sprite.h"
@ -79,11 +77,7 @@ JWidget statusbar_new()
{ \ { \
(name) = jbutton_new(text); \ (name) = jbutton_new(text); \
(name)->user_data[0] = statusbar; \ (name)->user_data[0] = statusbar; \
\ setup_mini_look(name); \
Vaca::SharedPtr<SkinProperty> skinProp(new SkinProperty); \
skinProp->setMiniLook(true); \
(name)->setProperty(skinProp); \
\
jbutton_add_command_data((name), button_command, (void *)(data)); \ jbutton_add_command_data((name), button_command, (void *)(data)); \
} }
@ -114,9 +108,7 @@ JWidget statusbar_new()
BUTTON_NEW(statusbar->b_layer, "*Current Layer*", ACTION_LAYER); BUTTON_NEW(statusbar->b_layer, "*Current Layer*", ACTION_LAYER);
statusbar->slider = jslider_new(0, 255, 255); statusbar->slider = jslider_new(0, 255, 255);
Vaca::SharedPtr<SkinProperty> skinProp(new SkinProperty); setup_mini_look(statusbar->slider);
skinProp->setMiniLook(true);
statusbar->slider->setProperty(skinProp);
ICON_NEW(statusbar->b_first, GFX_ANI_FIRST, ACTION_FIRST); ICON_NEW(statusbar->b_first, GFX_ANI_FIRST, ACTION_FIRST);
ICON_NEW(statusbar->b_prev, GFX_ANI_PREV, ACTION_PREV); ICON_NEW(statusbar->b_prev, GFX_ANI_PREV, ACTION_PREV);