mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 08:12:05 +00:00
Simple hack to strawman layout to make toolbars with icon on the side create narrow buttons.
This commit is contained in:
parent
1c1918cd05
commit
5cca4d5199
@ -172,6 +172,14 @@ CRDFToolbar :: LayoutButtons ( )
|
||||
{
|
||||
Uint32 horiz = 20;
|
||||
|
||||
bool iconOnTop = false;
|
||||
char* value = NULL;
|
||||
PRBool success = HT_GetTemplateData ( TopNode(), gNavCenter->toolbarBitmapPosition, HT_COLUMN_STRING, &value );
|
||||
if ( success && value ) {
|
||||
if ( strcmp(value, "top") == 0 )
|
||||
iconOnTop = true;
|
||||
}
|
||||
|
||||
HT_Cursor cursor = HT_NewCursor(TopNode());
|
||||
if (cursor == NULL)
|
||||
return;
|
||||
@ -179,11 +187,20 @@ CRDFToolbar :: LayoutButtons ( )
|
||||
HT_Resource item = NULL;
|
||||
while (item = HT_GetNextItem(cursor)) {
|
||||
CRDFToolbarItem* button = reinterpret_cast<CRDFToolbarItem*>(HT_GetNodeFEData(item));
|
||||
Uint32 hDelta = 0;
|
||||
if ( button ) {
|
||||
if ( iconOnTop ) {
|
||||
button->ResizeFrameTo ( 50, 50, false );
|
||||
button->PlaceInSuperFrameAt ( horiz, 5, false );
|
||||
hDelta = 50;
|
||||
}
|
||||
horiz += 55;
|
||||
else {
|
||||
button->ResizeFrameTo ( 80, 20, false );
|
||||
button->PlaceInSuperFrameAt ( horiz, 5, false );
|
||||
hDelta = 80;
|
||||
}
|
||||
}
|
||||
horiz += hDelta;
|
||||
}
|
||||
Refresh();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user