Layer toolbar visible by default. Grafx2 now records which toolbars are visible on exit, and restores them next time.

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1327 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud
2010-02-08 18:58:42 +00:00
parent b0a700850f
commit 6f08d59f01
8 changed files with 68 additions and 32 deletions

24
init.c
View File

@@ -2657,3 +2657,27 @@ void Set_current_skin(const char *skinfile, T_Gui_skin *gfx)
Menu_bars[MENUBAR_LAYERS].Skin = (byte*)&(gfx->Layerbar_block);
Menu_bars[MENUBAR_STATUS].Skin = (byte*)&(gfx->Statusbar_block);
}
///
/// Based on which toolbars are visible, updates their offsets and
/// computes ::Menu_height and ::Menu_Y
void Compute_menu_offsets(void)
{
int i;
int offset;
// Recompute all offsets
offset=0;
Menu_height=0;
for (i = MENUBAR_COUNT-1; i >=0; i--)
{
Menu_bars[i].Top = offset;
if(Menu_bars[i].Visible)
{
offset += Menu_bars[i].Height;
Menu_height += Menu_bars[i].Height;
}
}
// Update global menu coordinates
Menu_Y = Screen_height - Menu_height * Menu_factor_Y;
}