Bladeren bron

Added title bar colour...

master
Ognjen Milan Robovic 1 week geleden
bovenliggende
commit
9ad5151048
1 gewijzigde bestanden met toevoegingen van 16 en 3 verwijderingen
  1. +16
    -3
      source/ui.adb

+ 16
- 3
source/ui.adb Bestand weergeven

@@ -51,6 +51,16 @@ package body ui is

structure_limit : constant natural := 12;

font_tint : array (style) of core.colour := (
(136, 136, 136, 255),
(119, 119, 238, 255),
(119, 238, 238, 255),
(136, 136, 136, 255),
(238, 119, 238, 255),
(136, 136, 136, 255),
(238, 119, 0, 255)
);

sprite : array (style, element) of core.sprite;
font : array (style) of core.font;

@@ -178,7 +188,9 @@ package body ui is
when gui_button =>
draw_frame (data.gui_list (x).info, button_data.x, button_data.y, button_data.width, button_data.height);
draw_icon (data.gui_list (x).image, data.gui_list (x).info, button_data.x + offset, button_data.y + offset);
write (data.gui_list (x).text, button_data.x + offset + core.icon, button_data.y + offset + 2);
write (data.gui_list (x).text,
button_data.x + offset + core.icon + (core.icon - font (active).scale) / 2,
button_data.y + offset + (core.icon - font (active).scale) / 2);
--
button_data.y := button_data.y + button_data.height;
when gui_orient =>
@@ -311,7 +323,7 @@ package body ui is
draw (text_lower_left, x, y + height - offset);
draw (text_lower_right, x + width - offset, y + height - offset);
--
write (core.read_text_box, x, y);
write (core.read_text_box, (core.icon - font (active).scale) / 2 + x + 4, (core.icon - font (active).scale) / 2 + y);
end draw_help_box;

------------------------------------------------------------------------------------------
@@ -341,13 +353,14 @@ package body ui is

procedure draw_title_bar (x, y, width : in integer; title : in string) is
middle_width : constant integer := width - sprite (active, title_bar_left).width - sprite (active, title_bar_right).width;
offset : constant integer := (sprite (active, title_bar_middle).height - font (active).scale) / 2;
begin
draw (title_bar_left, x, y - sprite (active, title_bar_left).height);
draw (title_bar_right, x + middle_width + sprite (active, title_bar_left).width, y - sprite (active, title_bar_right).height);
--
draw_horizontally (title_bar_middle, x + sprite (active, title_bar_left).width, y - sprite (active, title_bar_middle).height, middle_width);
--
write (title, x + sprite (active, title_bar_left).width, y - sprite (active, title_bar_middle).height / 2 - 12); -- 12 = font.height / 2
write (title, x + sprite (active, title_bar_left).width + offset, y - font (active).scale - 4, tint => font_tint (active));
end draw_title_bar;

------------------------------------------------------------------------------------------


Laden…
Annuleren
Opslaan