- added a 'collapse pulldown' icon to all headers that have it
- narrowed the space icon takes, looks pretty - the status (pulldown or not) is now stored locally per window, it was global flag in user settings.
This commit is contained in:
parent
32a03fe460
commit
41545885b8
|
@ -106,7 +106,7 @@ typedef struct ScrArea {
|
|||
char win_swap, win_equal;
|
||||
|
||||
short headbutlen, headbutofs;
|
||||
short cursor, rt;
|
||||
short cursor, flag;
|
||||
|
||||
ListBase spacedata;
|
||||
ListBase uiblocks;
|
||||
|
@ -115,6 +115,9 @@ typedef struct ScrArea {
|
|||
|
||||
#define MAXWIN 128
|
||||
|
||||
/* area->flag */
|
||||
#define HEADER_NO_PULLDOWN 1
|
||||
|
||||
/* If you change EDGEWIDTH, also do the global arrat edcol[] */
|
||||
#define EDGEWIDTH 1
|
||||
#define EDGEWIDTH2 0
|
||||
|
|
|
@ -171,8 +171,8 @@ extern UserDef U; /* from usiblender.c !!!! */
|
|||
#define WHEELZOOMDIR 4
|
||||
#define FILTERFILEEXTS 8
|
||||
#define DRAWVIEWINFO 16
|
||||
#define EVTTOCONSOLE 32 //print ghost events, here for tuhopuu compat. --phase
|
||||
#define FLIPINFOMENU 64
|
||||
#define EVTTOCONSOLE 32 // print ghost events, here for tuhopuu compat. --phase
|
||||
// old flag for hide pulldown was here
|
||||
#define FLIPFULLSCREEN 128
|
||||
#define ALLWINCODECS 256
|
||||
#define MENUOPENAUTO 512
|
||||
|
|
|
@ -1673,19 +1673,19 @@ void info_buttons(void)
|
|||
if(area_is_active_area(curarea)) uiBlockSetCol(block, TH_HEADER);
|
||||
else uiBlockSetCol(block, TH_HEADERDESEL);
|
||||
|
||||
if(U.uiflag & FLIPINFOMENU) {
|
||||
uiDefIconButS(block, TOG|BIT|6, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_RIGHT,
|
||||
if(curarea->flag & HEADER_NO_PULLDOWN) {
|
||||
uiDefIconButS(block, TOG|BIT|0, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_RIGHT,
|
||||
xco,2,XIC,YIC-2,
|
||||
&(U.uiflag), 0, 0, 0, 0, "Enables display of pulldown menus");/* dir */
|
||||
&(curarea->flag), 0, 0, 0, 0, "Enables display of pulldown menus");
|
||||
} else {
|
||||
uiDefIconButS(block, TOG|BIT|6, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_DOWN,
|
||||
uiDefIconButS(block, TOG|BIT|0, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_DOWN,
|
||||
xco,2,XIC,YIC-2,
|
||||
&(U.uiflag), 0, 0, 0, 0, "Hides pulldown menus");/* dir */
|
||||
&(curarea->flag), 0, 0, 0, 0, "Hides pulldown menus");
|
||||
}
|
||||
xco+=XIC;
|
||||
|
||||
if(U.uiflag & FLIPINFOMENU) {
|
||||
} else {
|
||||
if((curarea->flag & HEADER_NO_PULLDOWN)==0) {
|
||||
|
||||
uiBlockSetEmboss(block, UI_EMBOSSP);
|
||||
|
||||
/* the 'xmax - 3' rather than xmax is to prevent some weird flickering where the highlighted
|
||||
|
@ -1731,8 +1731,6 @@ void info_buttons(void)
|
|||
uiDefIconTextButC(block, ICONTEXTROW,B_NEWSPACE, ICON_VIEW3D, windowtype_pup(), 8,0,XIC+10,YIC, &(curarea->butspacetype), 1.0, SPACEICONMAX, 0, 0, "Displays Current Window Type. Click for menu of available types.");
|
||||
|
||||
/* STD SCREEN BUTTONS */
|
||||
// xco+= XIC;
|
||||
xco+= 4;
|
||||
xco= std_libbuttons(block, xco, 0, 0, NULL, B_INFOSCR, (ID *)G.curscreen, 0, &G.curscreen->screennr, 1, 1, B_INFODELSCR, 0, 0);
|
||||
|
||||
/* STD SCENE BUTTONS */
|
||||
|
|
|
@ -638,41 +638,53 @@ void ipo_buttons(void)
|
|||
curarea->butspacetype= SPACE_IPO;
|
||||
|
||||
xco = 8;
|
||||
|
||||
uiDefIconTextButC(block, ICONTEXTROW,B_NEWSPACE, ICON_VIEW3D, windowtype_pup(), xco,0,XIC+10,YIC, &(curarea->butspacetype), 1.0, SPACEICONMAX, 0, 0, "Displays Current Window Type. Click for menu of available types.");
|
||||
|
||||
xco+= XIC+22;
|
||||
uiDefIconTextButC(block, ICONTEXTROW,B_NEWSPACE, ICON_VIEW3D, windowtype_pup(), xco,0,XIC+8,YIC, &(curarea->butspacetype), 1.0, SPACEICONMAX, 0, 0, "Displays Current Window Type. Click for menu of available types.");
|
||||
xco+= XIC+10;
|
||||
|
||||
test_editipo(); /* test if current editipo is OK, make_editipo sets v2d->cur */
|
||||
|
||||
uiBlockSetEmboss(block, UI_EMBOSSN);
|
||||
if(curarea->flag & HEADER_NO_PULLDOWN) {
|
||||
uiDefIconButS(block, TOG|BIT|0, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_RIGHT,
|
||||
xco,2,XIC,YIC-2,
|
||||
&(curarea->flag), 0, 0, 0, 0, "Enables display of pulldown menus");
|
||||
} else {
|
||||
uiDefIconButS(block, TOG|BIT|0, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_DOWN,
|
||||
xco,2,XIC,YIC-2,
|
||||
&(curarea->flag), 0, 0, 0, 0, "Hides pulldown menus");
|
||||
}
|
||||
uiBlockSetEmboss(block, UI_EMBOSS);
|
||||
xco+=XIC;
|
||||
|
||||
/* pull down menus */
|
||||
uiBlockSetEmboss(block, UI_EMBOSSP);
|
||||
|
||||
ei = get_editipo();
|
||||
|
||||
xmax= GetButStringLength("View");
|
||||
uiDefBlockBut(block,ipo_viewmenu, NULL, "View", xco, 0, xmax, 20, "");
|
||||
xco+=xmax;
|
||||
|
||||
xmax= GetButStringLength("Select");
|
||||
uiDefBlockBut(block,ipo_selectmenu, NULL, "Select", xco, 0, xmax, 20, "");
|
||||
xco+=xmax;
|
||||
|
||||
if (G.sipo->showkey) {
|
||||
xmax= GetButStringLength("Key");
|
||||
uiDefBlockBut(block,ipo_editmenu, NULL, "Key", xco, 0, xmax, 20, "");
|
||||
if((curarea->flag & HEADER_NO_PULLDOWN)==0) {
|
||||
uiBlockSetEmboss(block, UI_EMBOSSP);
|
||||
|
||||
ei = get_editipo();
|
||||
|
||||
xmax= GetButStringLength("View");
|
||||
uiDefBlockBut(block,ipo_viewmenu, NULL, "View", xco, 0, xmax, 20, "");
|
||||
xco+=xmax;
|
||||
|
||||
xmax= GetButStringLength("Select");
|
||||
uiDefBlockBut(block,ipo_selectmenu, NULL, "Select", xco, 0, xmax, 20, "");
|
||||
xco+=xmax;
|
||||
|
||||
if (G.sipo->showkey) {
|
||||
xmax= GetButStringLength("Key");
|
||||
uiDefBlockBut(block,ipo_editmenu, NULL, "Key", xco, 0, xmax, 20, "");
|
||||
}
|
||||
else if(ei != NULL && (ei->flag & IPO_EDIT)) {
|
||||
xmax= GetButStringLength("Point");
|
||||
uiDefBlockBut(block,ipo_editmenu, NULL, "Point", xco, 0, xmax, 20, "");
|
||||
}
|
||||
else {
|
||||
xmax= GetButStringLength("Curve");
|
||||
uiDefBlockBut(block,ipo_editmenu, NULL, "Curve", xco, 0, xmax, 20, "");
|
||||
}
|
||||
|
||||
xco+=xmax;
|
||||
}
|
||||
else if(ei != NULL && (ei->flag & IPO_EDIT)) {
|
||||
xmax= GetButStringLength("Point");
|
||||
uiDefBlockBut(block,ipo_editmenu, NULL, "Point", xco, 0, xmax, 20, "");
|
||||
}
|
||||
else {
|
||||
xmax= GetButStringLength("Curve");
|
||||
uiDefBlockBut(block,ipo_editmenu, NULL, "Curve", xco, 0, xmax, 20, "");
|
||||
}
|
||||
|
||||
xco+=xmax;
|
||||
|
||||
|
||||
/* end of pull down menus */
|
||||
uiBlockSetEmboss(block, UI_EMBOSSX);
|
||||
|
@ -703,7 +715,6 @@ void ipo_buttons(void)
|
|||
else if (G.sipo->blocktype == ID_SEQ)
|
||||
icon = ICON_SEQUENCE;
|
||||
|
||||
xco+= 5;
|
||||
uiDefIconTextButS(block, MENU, B_IPOMAIN, icon, ipo_modeselect_pup(), xco,0,100,20, &(G.sipo->blocktype), 0, 0, 0, 0, "Display IPO type");
|
||||
|
||||
xco += 85;
|
||||
|
|
|
@ -424,34 +424,46 @@ void seq_buttons()
|
|||
curarea->butspacetype= SPACE_SEQ;
|
||||
|
||||
xco = 8;
|
||||
|
||||
uiDefIconTextButC(block, ICONTEXTROW,B_NEWSPACE, ICON_VIEW3D, windowtype_pup(), xco,0,XIC+10,YIC, &(curarea->butspacetype), 1.0, SPACEICONMAX, 0, 0, "Displays Current Window Type. Click for menu of available types.");
|
||||
xco+= XIC+10;
|
||||
|
||||
uiBlockSetEmboss(block, UI_EMBOSSN);
|
||||
if(curarea->flag & HEADER_NO_PULLDOWN) {
|
||||
uiDefIconButS(block, TOG|BIT|0, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_RIGHT,
|
||||
xco,2,XIC,YIC-2,
|
||||
&(curarea->flag), 0, 0, 0, 0, "Enables display of pulldown menus");
|
||||
} else {
|
||||
uiDefIconButS(block, TOG|BIT|0, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_DOWN,
|
||||
xco,2,XIC,YIC-2,
|
||||
&(curarea->flag), 0, 0, 0, 0, "Hides pulldown menus");
|
||||
}
|
||||
uiBlockSetEmboss(block, UI_EMBOSS);
|
||||
xco+=XIC;
|
||||
|
||||
xco+= XIC+22;
|
||||
|
||||
/* pull down menus */
|
||||
uiBlockSetEmboss(block, UI_EMBOSSP);
|
||||
|
||||
xmax= GetButStringLength("View");
|
||||
uiDefBlockBut(block,seq_viewmenu, NULL, "View", xco, 0, xmax, 20, "");
|
||||
xco+=xmax;
|
||||
|
||||
xmax= GetButStringLength("Select");
|
||||
uiDefBlockBut(block,seq_selectmenu, NULL, "Select", xco, 0, xmax, 20, "");
|
||||
xco+=xmax;
|
||||
|
||||
xmax= GetButStringLength("Add");
|
||||
uiDefBlockBut(block, seq_addmenu, NULL, "Add", xco, 0, xmax, 20, "");
|
||||
xco+= xmax;
|
||||
|
||||
xmax= GetButStringLength("Strip");
|
||||
uiDefBlockBut(block, seq_editmenu, NULL, "Strip", xco, 0, xmax, 20, "");
|
||||
xco+= xmax;
|
||||
|
||||
/* end of pull down menus */
|
||||
uiBlockSetEmboss(block, UI_EMBOSSX);
|
||||
|
||||
xco+= 10;
|
||||
if((curarea->flag & HEADER_NO_PULLDOWN)==0) {
|
||||
uiBlockSetEmboss(block, UI_EMBOSSP);
|
||||
|
||||
xmax= GetButStringLength("View");
|
||||
uiDefBlockBut(block,seq_viewmenu, NULL, "View", xco, 0, xmax, 20, "");
|
||||
xco+=xmax;
|
||||
|
||||
xmax= GetButStringLength("Select");
|
||||
uiDefBlockBut(block,seq_selectmenu, NULL, "Select", xco, 0, xmax, 20, "");
|
||||
xco+=xmax;
|
||||
|
||||
xmax= GetButStringLength("Add");
|
||||
uiDefBlockBut(block, seq_addmenu, NULL, "Add", xco, 0, xmax, 20, "");
|
||||
xco+= xmax;
|
||||
|
||||
xmax= GetButStringLength("Strip");
|
||||
uiDefBlockBut(block, seq_editmenu, NULL, "Strip", xco, 0, xmax, 20, "");
|
||||
xco+= xmax;
|
||||
|
||||
/* end of pull down menus */
|
||||
uiBlockSetEmboss(block, UI_EMBOSS);
|
||||
}
|
||||
|
||||
/* IMAGE */
|
||||
uiDefIconButS(block, TOG, B_REDR, ICON_IMAGE_COL, xco,0,XIC,YIC, &sseq->mainb, 0, 0, 0, 0, "Toggles image display");
|
||||
|
|
|
@ -463,24 +463,36 @@ void text_buttons(void)
|
|||
curarea->butspacetype= SPACE_TEXT;
|
||||
|
||||
xco = 8;
|
||||
|
||||
uiDefIconTextButC(block, ICONTEXTROW,B_NEWSPACE, ICON_VIEW3D, windowtype_pup(), xco,0,XIC+10,YIC, &(curarea->butspacetype), 1.0, SPACEICONMAX, 0, 0, "Displays Current Window Type. Click for menu of available types.");
|
||||
xco+= XIC+10;
|
||||
|
||||
xco+= XIC+22;
|
||||
|
||||
/* pull down menus */
|
||||
uiBlockSetEmboss(block, UI_EMBOSSP);
|
||||
|
||||
xmax= GetButStringLength("File");
|
||||
uiDefBlockBut(block,text_filemenu, NULL, "File", xco, 0, xmax, 20, "");
|
||||
xco+=xmax;
|
||||
|
||||
if(text) {
|
||||
xmax= GetButStringLength("Edit");
|
||||
uiDefBlockBut(block,text_editmenu, NULL, "Edit", xco, 0, xmax, 20, "");
|
||||
xco+=xmax;
|
||||
uiBlockSetEmboss(block, UI_EMBOSSN);
|
||||
if(curarea->flag & HEADER_NO_PULLDOWN) {
|
||||
uiDefIconButS(block, TOG|BIT|0, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_RIGHT,
|
||||
xco,2,XIC,YIC-2,
|
||||
&(curarea->flag), 0, 0, 0, 0, "Enables display of pulldown menus");
|
||||
} else {
|
||||
uiDefIconButS(block, TOG|BIT|0, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_DOWN,
|
||||
xco,2,XIC,YIC-2,
|
||||
&(curarea->flag), 0, 0, 0, 0, "Hides pulldown menus");
|
||||
}
|
||||
uiBlockSetEmboss(block, UI_EMBOSS);
|
||||
xco+=XIC;
|
||||
|
||||
/* pull down menus */
|
||||
if((curarea->flag & HEADER_NO_PULLDOWN)==0) {
|
||||
uiBlockSetEmboss(block, UI_EMBOSSP);
|
||||
|
||||
xmax= GetButStringLength("File");
|
||||
uiDefBlockBut(block,text_filemenu, NULL, "File", xco, 0, xmax, 20, "");
|
||||
xco+=xmax;
|
||||
|
||||
if(text) {
|
||||
xmax= GetButStringLength("Edit");
|
||||
uiDefBlockBut(block,text_editmenu, NULL, "Edit", xco, 0, xmax, 20, "");
|
||||
xco+=xmax;
|
||||
}
|
||||
}
|
||||
uiBlockSetEmboss(block, UI_EMBOSSX);
|
||||
xco += 10;
|
||||
|
||||
|
|
|
@ -2893,26 +2893,10 @@ void do_view3d_buttons(short event)
|
|||
}
|
||||
}
|
||||
|
||||
void view3d_buttons(void)
|
||||
static void view3d_header_pulldowns(uiBlock *block, short *xcoord)
|
||||
{
|
||||
uiBlock *block;
|
||||
int a;
|
||||
short xco = 0;
|
||||
short xmax;
|
||||
short xmax, xco= *xcoord;
|
||||
|
||||
block= uiNewBlock(&curarea->uiblocks, "header view3d", UI_EMBOSS, UI_HELV, curarea->headwin);
|
||||
|
||||
if(area_is_active_area(curarea)) uiBlockSetCol(block, TH_HEADER);
|
||||
else uiBlockSetCol(block, TH_HEADERDESEL);
|
||||
|
||||
curarea->butspacetype= SPACE_VIEW3D;
|
||||
|
||||
xco = 8;
|
||||
|
||||
uiDefIconTextButC(block, ICONTEXTROW,B_NEWSPACE, ICON_VIEW3D, windowtype_pup(), xco,0,XIC+10,YIC, &(curarea->butspacetype), 1.0, SPACEICONMAX, 0, 0, "Displays Current Window Type. Click for menu of available types.");
|
||||
|
||||
xco+= XIC+22;
|
||||
|
||||
/* pull down menus */
|
||||
uiBlockSetEmboss(block, UI_EMBOSSP);
|
||||
|
||||
|
@ -3014,7 +2998,43 @@ void view3d_buttons(void)
|
|||
xco+= xmax;
|
||||
}
|
||||
|
||||
/* end pulldowns, other buttons: */
|
||||
*xcoord= xco;
|
||||
}
|
||||
|
||||
void view3d_buttons(void)
|
||||
{
|
||||
uiBlock *block;
|
||||
int a;
|
||||
short xco = 0;
|
||||
|
||||
block= uiNewBlock(&curarea->uiblocks, "header view3d", UI_EMBOSS, UI_HELV, curarea->headwin);
|
||||
|
||||
if(area_is_active_area(curarea)) uiBlockSetCol(block, TH_HEADER);
|
||||
else uiBlockSetCol(block, TH_HEADERDESEL);
|
||||
|
||||
curarea->butspacetype= SPACE_VIEW3D;
|
||||
|
||||
xco = 8;
|
||||
uiDefIconTextButC(block, ICONTEXTROW,B_NEWSPACE, ICON_VIEW3D, windowtype_pup(), xco,0,XIC+10,YIC, &(curarea->butspacetype), 1.0, SPACEICONMAX, 0, 0, "Displays Current Window Type. Click for menu of available types.");
|
||||
xco+= XIC+10;
|
||||
|
||||
uiBlockSetEmboss(block, UI_EMBOSSN);
|
||||
if(curarea->flag & HEADER_NO_PULLDOWN) {
|
||||
uiDefIconButS(block, TOG|BIT|0, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_RIGHT,
|
||||
xco,2,XIC,YIC-2,
|
||||
&(curarea->flag), 0, 0, 0, 0, "Enables display of pulldown menus");
|
||||
} else {
|
||||
uiDefIconButS(block, TOG|BIT|0, B_FLIPINFOMENU, ICON_DISCLOSURE_TRI_DOWN,
|
||||
xco,2,XIC,YIC-2,
|
||||
&(curarea->flag), 0, 0, 0, 0, "Hides pulldown menus");
|
||||
}
|
||||
uiBlockSetEmboss(block, UI_EMBOSS);
|
||||
xco+=XIC;
|
||||
|
||||
if((curarea->flag & HEADER_NO_PULLDOWN)==0)
|
||||
view3d_header_pulldowns(block, &xco);
|
||||
|
||||
/* other buttons: */
|
||||
uiBlockSetEmboss(block, UI_EMBOSS);
|
||||
|
||||
/* mode */
|
||||
|
@ -3038,8 +3058,6 @@ void view3d_buttons(void)
|
|||
G.vd->flag |= V3D_POSEMODE;
|
||||
}
|
||||
|
||||
xco+= 10;
|
||||
|
||||
uiDefIconTextButS(block, MENU, B_MODESELECT, (G.vd->modeselect),view3d_modeselect_pup() ,
|
||||
xco,0,126,20, &(G.vd->modeselect), 0, 0, 0, 0, "Mode:");
|
||||
|
||||
|
|
Loading…
Reference in New Issue