From: Mikko Rasa Date: Sat, 11 Oct 2008 18:27:05 +0000 (+0000) Subject: Rename the basic skin to encourage reusability X-Git-Tag: 1.0~2 X-Git-Url: http://git.tdb.fi/?p=libs%2Fgltk.git;a=commitdiff_plain;h=eac6b43052bb23418efb569e2238bde56c71c9bf Rename the basic skin to encourage reusability Add styles for the rest of the widgets --- diff --git a/basic.skin b/basic.skin new file mode 100644 index 0000000..1dd8d41 --- /dev/null +++ b/basic.skin @@ -0,0 +1,360 @@ +/* $Id$ */ + +default_font "dejavu-10.font"; + +graphic "grey_raised" +{ + texture "basic_skin.png"; + slice 0 52 12 12; + border { left 3; right 3; top 3; bottom 3; }; +}; + +graphic "light_grey_raised" +{ + texture "basic_skin.png"; + slice 0 39 12 12; + border { left 3; right 3; top 3; bottom 3; }; +}; + +graphic "dark_grey_sunken" +{ + texture "basic_skin.png"; + slice 14 52 12 12; + border { left 3; right 3; top 3; bottom 3; }; +}; + +style "button" +{ + font_color 0.0 0.0 0.0; + + part + { + graphic NORMAL "grey_raised"; + graphic HOVER "light_grey_raised"; + graphic ACTIVE "dark_grey_sunken"; + }; + + special "text" + { + align 0.5 0.5; + fill 0.0 0.0; + margin { left 3; right 3; top 3; bottom 3; }; + }; +}; + +graphic "white_sunken" +{ + texture "basic_skin.png"; + slice 0 26 12 12; + border { left 3; right 3; top 3; bottom 3; }; +}; + +graphic "check_tick" +{ + texture "basic_skin.png"; + slice 28 56 8 8; +}; + +graphic "light_grey_flat" +{ + texture "basic_skin.png"; + slice 14 14 10 10; +}; + +style "toggle" +{ + font_color 0.0 0.0 0.0; + + part + { + graphic HOVER "light_grey_flat"; + }; + + part + { + graphic NORMAL "white_sunken"; + align 0.0 0.5; + fill 0.0 0.0; + }; + + part + { + graphic ACTIVE "check_tick"; + align 0.0 0.5; + fill 0.0 0.0; + margin { left 2; }; + }; + + special "text" + { + align 0.0 0.5; + fill 0.0 0.0; + margin { left 14; }; + }; +}; + +graphic "white_circle_sunken" +{ + texture "basic_skin.png"; + slice 13 26 12 12; +}; + +graphic "option_dot" +{ + texture "basic_skin.png"; + slice 37 58 6 6; +}; + +style "toggle-option" +{ + font_color 0.0 0.0 0.0; + + part + { + graphic HOVER "light_grey_flat"; + }; + + part + { + graphic NORMAL "white_circle_sunken"; + align 0.0 0.5; + fill 0.0 0.0; + }; + + part + { + graphic ACTIVE "option_dot"; + align 0.0 0.5; + fill 0.0 0.0; + margin { left 3; }; + }; + + special "text" + { + align 0.0 0.5; + fill 0.0 0.0; + margin { left 14; }; + }; +}; + +style "label" +{ + font_color 0.0 0.0 0.0; + + special "text" + { + align 0.5 0.5; + fill 0.0 0.0; + }; +}; + +graphic "entry_cursor" +{ + texture "basic_skin.png"; + slice 26 56 1 8; +}; + +style "entry" +{ + font_color 0.0 0.0 0.0; + + part + { + graphic NORMAL "white_sunken"; + }; + + special "text" + { + align 0.0 0.5; + fill 0.0 0.0; + margin { left 3; right 3; top 3; bottom 3; }; + }; + + special "cursor" + { + graphic FOCUS "entry_cursor"; + align 0.0 0.0; + fill 0.0 1.0; + margin { left 3; right 3; top 3; bottom 3; }; + }; +}; + +graphic "dark_grey_sunken_shallow" +{ + texture "basic_skin.png"; + slice 13 39 12 12; + border { left 3; right 3; top 3; bottom 3; }; +}; + +graphic "hthumb" +{ + texture "basic_skin.png"; + slice 26 45 20 10; + border { left 3; right 3; top 3; bottom 3; }; +}; + +graphic "hthumb_light" +{ + texture "basic_skin.png"; + slice 26 34 20 10; + border { left 3; right 3; top 3; bottom 3; }; +}; + +style "hslider" +{ + part + { + graphic NORMAL "dark_grey_sunken_shallow"; + }; + + special "slider" + { + graphic NORMAL "hthumb"; + graphic HOVER "hthumb_light"; + fill 0.0 1.0; + margin { left 1; right 1; top 1; bottom 1; }; + }; +}; + +graphic "vthumb" +{ + texture "basic_skin.png"; + slice 26 13 10 20; + border { left 3; right 3; top 3; bottom 3; }; +}; + +graphic "vthumb_light" +{ + texture "basic_skin.png"; + slice 37 13 10 20; + border { left 3; right 3; top 3; bottom 3; }; +}; + +style "vslider" +{ + part + { + graphic NORMAL "dark_grey_sunken_shallow"; + }; + + special "slider" + { + graphic NORMAL "vthumb"; + graphic HOVER "vthumb_light"; + fill 1.0 0.0; + margin { left 1; right 1; top 1; bottom 1; }; + }; +}; + +graphic "blue_flat" +{ + texture "basic_skin.png"; + slice 1 1 10 10; +}; + +style "list" +{ + font_color 0.0 0.0 0.0; + + part + { + graphic NORMAL "white_sunken"; + margin { right 12; }; + }; + + special "slider" + { + size 12 12; + fill 0.0 1.0; + align 1.0 0.5; + //margin { right 1; top 1; bottom 1; }; + }; + + special "selection" + { + graphic NORMAL "blue_flat"; + margin { left 3; right 14; top 3; bottom 3; }; + }; + + special "items" + { + margin { left 3; right 14; top 3; bottom 3; }; + }; +}; + +graphic "grey_raised_divided" +{ + texture "basic_skin.png"; + slice 13 0 20 12; + border { left 3; right 15; top 5; bottom 5; }; +}; + +graphic "light_grey_raised_divided" +{ + texture "basic_skin.png"; + slice 34 0 20 12; + border { left 3; right 15; top 5; bottom 5; }; +}; + +graphic "arrow_down" +{ + texture "basic_skin.png"; + slice 44 56 8 8; +}; + +graphic "arrow_left" +{ + texture "basic_skin.png"; + slice 53 56 8 8; +}; + +style "dropdown" +{ + font_color 0.0 0.0 0.0; + + part + { + graphic NORMAL "grey_raised_divided"; + graphic HOVER "light_grey_raised_divided"; + }; + + part + { + graphic NORMAL "arrow_left"; + graphic ACTIVE "arrow_down"; + fill 0.0 0.0; + align 1.0 0.5; + margin { right 3; }; + }; + + special "text" + { + fill 0.0 0.0; + align 0.0 0.5; + margin { left 4; }; + }; + + special "list"; +}; + +graphic "grey_beveled" +{ + texture "basic_skin.png"; + slice 0 13 12 12; + border { left 4; right 4; top 4; bottom 4; }; +}; + +style "panel" +{ + part + { + graphic NORMAL "grey_beveled"; + }; + + special "children"; +}; + +style "root" +{ + special "children"; +}; diff --git a/basic_skin.png b/basic_skin.png new file mode 100644 index 0000000..ac4907d Binary files /dev/null and b/basic_skin.png differ diff --git a/helloworld.cpp b/helloworld.cpp index 95e5f59..b7fa6ee 100644 --- a/helloworld.cpp +++ b/helloworld.cpp @@ -64,7 +64,7 @@ HelloWorld::HelloWorld(int, char **): wnd.signal_close.connect(sigc::bind(sigc::mem_fun(this, &HelloWorld::exit), 0)); // Load resources. This must be done before any widgets are created. - DataFile::load(res, "helloworld.gui"); + DataFile::load(res, "basic.skin"); // A Root receives input from a Graphics::Window and passes it on root=new GLtk::Root(res, wnd); diff --git a/helloworld.gui b/helloworld.gui deleted file mode 100644 index 94188c7..0000000 --- a/helloworld.gui +++ /dev/null @@ -1,106 +0,0 @@ -/* $Id$ */ - -default_font "dejavu-10.font"; - -graphic "button_bg" -{ - texture "helloworld.png"; - slice 0 54 20 10; - border { left 3; right 3; top 3; bottom 3; }; -}; - -graphic "button_bg_pressed" -{ - texture "helloworld.png"; - slice 22 54 20 10; - border { left 3; right 3; top 3; bottom 3; }; -}; - -style "button" -{ - font_color 0.0 0.0 0.0; - - part - { - graphic NORMAL "button_bg"; - graphic ACTIVE "button_bg_pressed"; - }; - - special "text" - { - align 0.5 0.5; - fill 0.0 0.0; - margin { left 3; right 3; top 3; bottom 3; }; - }; -}; - -style "label" -{ - font_color 0.0 0.0 0.0; - - special "text" - { - align 0.5 0.5; - fill 0.0 0.0; - }; -}; - -graphic "entry_bg" -{ - texture "helloworld.png"; - slice 0 42 20 10; - border { left 3; right 3; top 3; bottom 3; }; -}; - -graphic "entry_cursor" -{ - texture "helloworld.png"; - slice 22 42 1 10; -}; - -style "entry" -{ - font_color 0.0 0.0 0.0; - - part - { - graphic NORMAL "entry_bg"; - }; - - special "text" - { - align 0.0 0.5; - fill 0.0 0.0; - margin { left 3; right 3; top 3; bottom 3; }; - }; - - special "cursor" - { - graphic FOCUS "entry_cursor"; - align 0.0 0.0; - fill 0.0 1.0; - margin { left 3; right 3; top 3; bottom 3; }; - }; -}; - -graphic "panel_bg" -{ - texture "helloworld.png"; - slice 0 20 20 20; - border { left 4; right 4; top 4; bottom 4; }; -}; - -style "panel" -{ - part - { - graphic NORMAL "panel_bg"; - }; - - special "children"; -}; - -style "root" -{ - special "children"; -}; diff --git a/helloworld.png b/helloworld.png deleted file mode 100644 index 86b945a..0000000 Binary files a/helloworld.png and /dev/null differ