Skip to content

Commit 95c02e6

Browse files
committed
various gui twaeks
1 parent 91860b7 commit 95c02e6

File tree

17 files changed

+43
-43
lines changed

17 files changed

+43
-43
lines changed

LFSDock/ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
0.2.0
2+
GUI tweaks.
23
Added run prefs for dock to launcher popup menu.
34
Code clean.
45
Fixed current date highlight for single digit.

LFSDock/LFSDock/src/calendar.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ int addCalendar(int x,int y,int grav)
229229
editbox->LFSTK_setIgnores(false,false);
230230
editbox->LFSTK_addHighLights(dx,dy,dl,datesHilite[0]);
231231
//TODO//
232-
// editbox->LFSTK_setGadgetColourPair(NORMALCOLOUR,dockBGColour,dockTextColour);
232+
editbox->LFSTK_setGadgetColourPair(NORMALCOLOUR,dockBGColour,dockTextColour);
233233
//editbox->LFSTK_setAlpha(1.0);
234234
//editbox->LFSTK_setTile(NULL,0);
235235
//calWindow->LFSTK_setTile(NULL,0);

LFSDock/LFSDock/src/callbacks.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ bool contextCB(void *p,void* ud)
157157

158158
launcherExitCB(lwc->popupFromGadget,ud);
159159
lwc->popupFromGadget=NULL;
160+
dockWindow->LFSTK_clearWindow(true);
161+
XSync(apc->display,false);
160162
}
161163
return(true);
162164
}
@@ -208,7 +210,6 @@ void setGadgetPosition(LFSTK_gadgetClass *gadg,bool active)
208210

209211
bool popActionListEnterCB(LFSTK_gadgetClass*p,void* ud)
210212
{
211-
//fprintf(stderr,"popActionListEnterCB\n");
212213
return(true);
213214
}
214215

LFSDock/LFSDock/src/globals.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ LFSTK_windowClass *popActionWindow=NULL;
5757
LFSTK_listGadgetClass *popActionList=NULL;
5858
bool inSomeWindow=false;
5959
bool gotLaunchers=false;
60+
int popActionWindowYOffset=1;
6061

6162
//atoms
6263
Atom WM_STATE=None;

LFSDock/LFSDock/src/globals.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ extern LFSTK_windowClass *dockWindow;
115115
extern LFSTK_windowClass *popActionWindow;
116116
extern LFSTK_listGadgetClass *popActionList;
117117
extern bool inSomeWindow;
118+
extern int popActionWindowYOffset;
118119

119120
//atoms
120121
extern Atom WM_STATE;

LFSDock/LFSDock/src/launchers.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ bool launcherEnterCB(LFSTK_gadgetClass*p,void* ud)
3535
{
3636
std::string label;
3737
infoDataStruct ls;
38+
const geometryStruct *wingeom;
3839
launcherDataStruct lds=launchersArray.at((long unsigned int)ud);
40+
int offy;
3941

4042
setGadgetPosition(p,true);
4143
popActionList->LFSTK_freeList();
@@ -49,7 +51,10 @@ bool launcherEnterCB(LFSTK_gadgetClass*p,void* ud)
4951
popActionList->LFSTK_moveGadget(-1,-1);
5052
popActionWindow->userData=USERDATA(LAUNCHER);
5153
popActionWindow->LFSTK_resizeWindow(popActionList->LFSTK_getListMaxWidth()-2,GADGETHITE-2);
54+
55+
p->contextYOffset=popActionWindowYOffset;
5256
showhidetActionList(p,popActionWindow,popActionList);
57+
5358
inSomeWindow=true;
5459
}
5560
return(true);
@@ -62,6 +67,7 @@ bool launcherExitCB(LFSTK_gadgetClass *p,void* ud)
6267
setGadgetPosition(p,false);
6368
inSomeWindow=false;
6469
popActionListExitCB(NULL,(void*)1);
70+
dockWindow->LFSTK_clearWindow(true);
6571
}
6672
return(true);
6773
}
@@ -79,6 +85,7 @@ bool launcherCB(void *p,void* ud)
7985
propReturn pr;
8086

8187
showhidetActionList(NULL,popActionWindow,popActionList);
88+
XSync(apc->display,false);
8289

8390
if(p!=NULL)
8491
{
@@ -191,25 +198,17 @@ int addLaunchers(int x,int y,int grav)
191198
findlaunchers->LFSTK_findFiles(launchersDir.c_str(),false);
192199
findlaunchers->LFSTK_sortByName();
193200

194-
win=new windowInitStruct;//TODO//
195-
win->app=apc;
196-
win->windowName="";
197-
win->loadVars=true;
198-
win->x=100;
199-
win->y=100;
200-
win->w=200;
201-
win->h=200;
201+
win=apc->LFSTK_getDefaultWInit();
202+
win->windowName="X";
202203
win->wc=dockWindow;
203204
win->windowType=apc->appAtomsHashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_MENU"));
204-
win->app=apc;
205205
win->decorated=false;
206206
win->overRide=true;
207207
win->level=ABOVEALL;
208208

209209
apc->LFSTK_addWindow(win,"");
210210
launcherContextWindow=apc->windows->back().window;
211211
launcherContextWindow->LFSTK_setWindowColourName(NORMALCOLOUR,lc.c_str());
212-
213212
for(int j=BUTTONLAUNCH;j<NOMOREBUTONS;j++)
214213
{
215214
contextButtons[j]=new LFSTK_buttonClass(launcherContextWindow,contextLabelData[j],0,sy,GADGETWIDTH*2,24,NorthWestGravity);
@@ -250,6 +249,7 @@ int addLaunchers(int x,int y,int grav)
250249

251250
bc=new LFSTK_buttonClass(dockWindow,"",xpos,normalY,iconWidth,iconHeight);
252251
bc->LFSTK_setContextWindow(launcherContextWindow);
252+
253253
if(dockGravity==PANELSOUTH)
254254
bc->contextWindowPos=CONTEXTABOVECENTRE;
255255
else

LFSDock/LFSDock/src/main.cpp

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -123,28 +123,7 @@ bool windowDrop(LFSTK_windowClass *lwc,void* ud)
123123
void sanityCheck(void)
124124
{
125125
namespace fs=std::filesystem;
126-
// namespace fsfs=std::experimental::filesystem;
127-
//
128-
//
129-
//for (fsfs::path p : {"/var/tmp/example.txt", "/", "/var/tmp/."})
130-
// std::cout << "The parent path of " << p
131-
// << " is " << p.parent_path() << '\n';
132-
////
133-
///*
134-
//#include <experimental/filesystem>
135-
//#include <iostream>
136-
//namespace fs = std::experimental::filesystem;
137-
//
138-
//*/
139-
////fsfs=launchersDir;
140-
// fsfs::path p1;
141-
// p1=launchersDir;
142-
////c=launchersDir;
143-
//std::cout<<launchersDir<<std::endl;
144-
//std::cout<<p1.parent_path()<<std::endl;
145-
//std::cout<<p1.filename()<<std::endl;
146-
////fsfs::path=launchersDir;
147-
////std::cout<<fs::parent_path()<<std::endl;
126+
148127
if(!fs::exists(fs::status(launchersDir)))
149128
{
150129
fs::create_directories(launchersDir);
@@ -282,15 +261,19 @@ int main(int argc,char **argv)
282261
{
283262
case 2:
284263
iconWidth=48;
264+
popActionWindowYOffset=11;
285265
break;
286266
case 3:
287267
iconWidth=64;
268+
popActionWindowYOffset=7;
288269
break;
289270
case 4:
290271
iconWidth=96;
272+
popActionWindowYOffset=-1;
291273
break;
292274
default:
293275
iconWidth=32;
276+
popActionWindowYOffset=15;
294277
}
295278

296279
iconHeight=iconWidth+(iconWidth/2);
@@ -303,6 +286,7 @@ int main(int argc,char **argv)
303286
}
304287
else
305288
{
289+
popActionWindowYOffset=popActionWindowYOffset*-1;
306290
normalY=0;
307291
activeY=-extraSpace;
308292
}

LFSToolKit/ChangeLog

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
0.6.1
2+
Added optiona x/y offsets for gadget context menu.
3+
Fixed alpha for multiline class.
24
Moved function LFSTK_hashFromKey to util class and made static.
35
Removed redundant functions from prefs class.
46
Removed old 'c' code from save/load prefsfile.

LFSToolKit/LFSToolKit/lfstk/LFSTKGadget.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ class LFSTK_gadgetClass
7878
//context window
7979
LFSTK_windowClass *LFSTK_getContextWindow(void);
8080
void LFSTK_setContextWindow(LFSTK_windowClass *wc);
81+
int contextYOffset=0;
82+
int contextXOffset=0;
8183
int windowNumber=-1;
8284

8385
//DnD routines etc

LFSToolKit/LFSToolKit/lfstk/LFSTKLib.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,8 @@ bool LFSTK_lib::LFSTK_gadgetEvent(void *self,XEvent *e,int type)
400400

401401
lwc->popupFromGadget=gadget;
402402
gadget->LFSTK_getGeomWindowRelative(&geom,gadget->wc->app->rootWindow);
403+
geom.x+=gadget->contextXOffset;
404+
geom.y+=gadget->contextYOffset;
403405
switch(gadget->contextWindowPos)
404406
{
405407
case CONTEXTLEFT:

LFSToolKit/LFSToolKit/lfstk/LFSTKLineEdit.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -292,12 +292,12 @@ void LFSTK_lineEditClass::drawLabel(void)
292292
{
293293
int startchar=0;
294294
double yoffset=0;
295-
cairo_text_extents_t partextents;
296-
char *data;
297-
char undercurs[2]={0,0};
298-
char *aftercursor;
295+
cairo_text_extents_t partextents;
296+
char *data;
297+
char undercurs[2]={0,0};
298+
char *aftercursor;
299299
int maxchars;
300-
cairo_text_extents_t charextents;
300+
cairo_text_extents_t charextents;
301301

302302
cairo_save(this->cr);
303303
cairo_reset_clip(this->cr);

LFSToolKit/LFSToolKit/lfstk/LFSTKMultiLineEdit.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ void LFSTK_multiLineEditClass::drawText(void)
227227
cairo_save(this->cr);
228228
cairo_reset_clip(this->cr);
229229
cairo_set_source_rgba(this->cr,this->newGadgetBGColours.at(NORMALCOLOUR).RGBAColour.r,this->newGadgetBGColours.at(NORMALCOLOUR).RGBAColour.g,this->newGadgetBGColours.at(NORMALCOLOUR).RGBAColour.b,this->newGadgetBGColours.at(NORMALCOLOUR).RGBAColour.a);
230+
cairo_set_operator(this->cr,CAIRO_OPERATOR_SOURCE);
230231
cairo_paint(this->cr);
231232
cairo_restore(this->cr);
232233

LFSToolKit/examples/basic.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ int main(int argc, char **argv)
289289
apc->LFSTK_setTimer(1000000,true);
290290
apc->LFSTK_setTimerCallBack(timerCB,NULL);
291291

292-
popWindow=new LFSTK_toolWindowClass(apc->display,wc,apc->appAtomsHashed.at(apc->globalLib->prefs.LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_MENU")),0,0,200,100,"lfstkpopup",apc);
292+
popWindow=new LFSTK_toolWindowClass(apc->display,wc,apc->appAtomsHashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_MENU")),0,0,200,100,"lfstkpopup",apc);
293293

294294
LFSTK_labelClass *poplabel=new LFSTK_labelClass(popWindow,"This is a mouse enter callback",0,0,GADGETWIDTH*8,GADGETHITE,WestGravity);
295295
poplabel->LFSTK_setCairoFontDataParts("sB",20);

LFSToolKit/examples/image.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ int main(int argc, char **argv)
166166
win->w=200;
167167
win->h=200;
168168
win->wc=wc;
169-
win->windowType=apc->appAtomsHashed.at(apc->globalLib->prefs.LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_TOOL"));
169+
win->windowType=apc->appAtomsHashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_TOOL"));
170170

171171
win->decorated=false;
172172
win->overRide=true;

LFSToolKit/examples/lineedit.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,10 @@ int main(int argc, char **argv)
101101
hrs.back().gadget->LFSTK_setMouseCallBack(NULL,doMouseUp,NULL);
102102
hrs.back().gadget->LFSTK_setKeyCallBack(NULL,doKeyUp,USERDATA(12345));
103103
hrs.back().gadget->LFSTK_setGadgetDropCallBack(doDropped);
104-
//hrs.back().gadget->LFSTK_setAlpha(0.9);
104+
105+
106+
//hrs.back().gadget->LFSTK_setAlpha(0.2);
107+
//hrs.back().gadget->LFSTK_setGadgetColourPair(NORMALCOLOUR,"#20ff00ff","#20000000");
105108
//hrs.back().gadget->LFSTK_setColourName(NORMALCOLOUR,"#e0ffffff");
106109
//printf(">>>>hrs.back().gadget=%p\n",hrs.back().gadget);
107110
static_cast<LFSTK_lineEditClass*>(hrs.back().gadget)->LFSTK_setCallbackOnReturn(false);

LFSToolKit/examples/multilineedit.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ int main(int argc, char **argv)
9797

9898
//line edit
9999
editbox=new LFSTK_multiLineEditClass(wc,test_string,BORDER,sy,DIALOGWIDTH-BORDER-BORDER,GADGETHITE*10,BUTTONGRAV);
100+
//editbox->LFSTK_setGadgetColourPair(NORMALCOLOUR,"#c0ffffff","#ff000000");
101+
//editbox->LFSTK_setAlpha(0.0);
100102

101103
sy+=YSPACING+(GADGETHITE*10);
102104

LFSToolKit/examples/toggle.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ int main(int argc, char **argv)
144144
win->decorated=false;
145145
win->overRide=true;
146146
win->app=apc;
147-
win->windowType=apc->appAtomsHashed.at(apc->globalLib->prefs.LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_TOOL"));
147+
win->windowType=apc->appAtomsHashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_TOOL"));
148148
apc->LFSTK_addToolWindow(win);
149149
scwindow=apc->windows->back().window;//TODO//
150150
vsb=new LFSTK_scrollBarClass(scwindow,true,0,0,16,100);

0 commit comments

Comments
 (0)