Public feed #599573

std

public text v1 · immutable
Raw Edit
·published 2007-07-02 08:21 UTC
rendered paste body
Index: skin.cpp
===================================================================
--- skin.cpp	(revision 845)
+++ skin.cpp	(working copy)
@@ -184,15 +184,16 @@
 
 void PopupSkin::drawActionBar(MyBitmap *bmp, PopupWnd2 *wnd, int x, int y) const
 {
+	bool fitActionBar = (bool)DBGetContactSettingByte(NULL, ModuleName, "fitActionBar", FALSE);
 	for (int i = 0; i < wnd->getActionCount(); ++i)
 	{
 		SIZE szAction = measureAction(bmp->getDC(), &wnd->getActions()[i].actionA);
-		drawAction(bmp, &wnd->getActions()[i].actionA, x, y, wnd->getActions()[i].hover);
+		drawAction(bmp, &wnd->getActions()[i].actionA, x, fitActionBar?(y-szAction.cy):y, wnd->getActions()[i].hover);
 
 		wnd->getActions()[i].rc.left = x;
-		wnd->getActions()[i].rc.top = y;
+		wnd->getActions()[i].rc.top = fitActionBar?(y-szAction.cy):y;
 		wnd->getActions()[i].rc.right = x + szAction.cx;
-		wnd->getActions()[i].rc.bottom = y + szAction.cy;
+		wnd->getActions()[i].rc.bottom = fitActionBar?y:(y + szAction.cy);
 
 		if (PopUpOptions.actions & ACT_TEXT)
 		{
@@ -208,6 +209,7 @@
 {
 	if (!elements) return;
 
+	bool fitActionBar = (bool)DBGetContactSettingByte(NULL, ModuleName, "fitActionBar", FALSE);
 	SKINELEMENT *head = NULL;
 
 	int STYLE_SZ_CLOCK = 0;
@@ -321,7 +323,8 @@
 			if (szActions.cy)
 			{
 				szNew.cx = max(szNew.cx, szActions.cx);
-				szNew.cy += szActions.cy;
+				if( !fitActionBar )
+					szNew.cy += szActions.cy;
 				szNew.cy += 3;
 			}