mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 10:00:54 +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;
|
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());
|
HT_Cursor cursor = HT_NewCursor(TopNode());
|
||||||
if (cursor == NULL)
|
if (cursor == NULL)
|
||||||
return;
|
return;
|
||||||
@ -179,11 +187,20 @@ CRDFToolbar :: LayoutButtons ( )
|
|||||||
HT_Resource item = NULL;
|
HT_Resource item = NULL;
|
||||||
while (item = HT_GetNextItem(cursor)) {
|
while (item = HT_GetNextItem(cursor)) {
|
||||||
CRDFToolbarItem* button = reinterpret_cast<CRDFToolbarItem*>(HT_GetNodeFEData(item));
|
CRDFToolbarItem* button = reinterpret_cast<CRDFToolbarItem*>(HT_GetNodeFEData(item));
|
||||||
|
Uint32 hDelta = 0;
|
||||||
if ( button ) {
|
if ( button ) {
|
||||||
|
if ( iconOnTop ) {
|
||||||
button->ResizeFrameTo ( 50, 50, false );
|
button->ResizeFrameTo ( 50, 50, false );
|
||||||
button->PlaceInSuperFrameAt ( horiz, 5, 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();
|
Refresh();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user