diff --git a/LFSDock/ChangeLog b/LFSDock/ChangeLog index 9859828..cb504a7 100644 --- a/LFSDock/ChangeLog +++ b/LFSDock/ChangeLog @@ -1,4 +1,5 @@ 0.2.0 +GUI tweaks. Added run prefs for dock to launcher popup menu. Code clean. Fixed current date highlight for single digit. diff --git a/LFSDock/LFSDock/src/calendar.cpp b/LFSDock/LFSDock/src/calendar.cpp index 1d9b000..efc19d4 100644 --- a/LFSDock/LFSDock/src/calendar.cpp +++ b/LFSDock/LFSDock/src/calendar.cpp @@ -229,7 +229,7 @@ int addCalendar(int x,int y,int grav) editbox->LFSTK_setIgnores(false,false); editbox->LFSTK_addHighLights(dx,dy,dl,datesHilite[0]); //TODO// -// editbox->LFSTK_setGadgetColourPair(NORMALCOLOUR,dockBGColour,dockTextColour); + editbox->LFSTK_setGadgetColourPair(NORMALCOLOUR,dockBGColour,dockTextColour); //editbox->LFSTK_setAlpha(1.0); //editbox->LFSTK_setTile(NULL,0); //calWindow->LFSTK_setTile(NULL,0); diff --git a/LFSDock/LFSDock/src/callbacks.cpp b/LFSDock/LFSDock/src/callbacks.cpp index fe328dc..4ad1add 100644 --- a/LFSDock/LFSDock/src/callbacks.cpp +++ b/LFSDock/LFSDock/src/callbacks.cpp @@ -157,6 +157,8 @@ bool contextCB(void *p,void* ud) launcherExitCB(lwc->popupFromGadget,ud); lwc->popupFromGadget=NULL; + dockWindow->LFSTK_clearWindow(true); + XSync(apc->display,false); } return(true); } @@ -208,7 +210,6 @@ void setGadgetPosition(LFSTK_gadgetClass *gadg,bool active) bool popActionListEnterCB(LFSTK_gadgetClass*p,void* ud) { -//fprintf(stderr,"popActionListEnterCB\n"); return(true); } diff --git a/LFSDock/LFSDock/src/globals.cpp b/LFSDock/LFSDock/src/globals.cpp index 8e1733d..547ef27 100644 --- a/LFSDock/LFSDock/src/globals.cpp +++ b/LFSDock/LFSDock/src/globals.cpp @@ -57,6 +57,7 @@ LFSTK_windowClass *popActionWindow=NULL; LFSTK_listGadgetClass *popActionList=NULL; bool inSomeWindow=false; bool gotLaunchers=false; +int popActionWindowYOffset=1; //atoms Atom WM_STATE=None; diff --git a/LFSDock/LFSDock/src/globals.h b/LFSDock/LFSDock/src/globals.h index da0baef..f4a55dd 100644 --- a/LFSDock/LFSDock/src/globals.h +++ b/LFSDock/LFSDock/src/globals.h @@ -115,6 +115,7 @@ extern LFSTK_windowClass *dockWindow; extern LFSTK_windowClass *popActionWindow; extern LFSTK_listGadgetClass *popActionList; extern bool inSomeWindow; +extern int popActionWindowYOffset; //atoms extern Atom WM_STATE; diff --git a/LFSDock/LFSDock/src/launchers.cpp b/LFSDock/LFSDock/src/launchers.cpp index 4ba3e8b..e066cb6 100644 --- a/LFSDock/LFSDock/src/launchers.cpp +++ b/LFSDock/LFSDock/src/launchers.cpp @@ -35,7 +35,9 @@ bool launcherEnterCB(LFSTK_gadgetClass*p,void* ud) { std::string label; infoDataStruct ls; + const geometryStruct *wingeom; launcherDataStruct lds=launchersArray.at((long unsigned int)ud); + int offy; setGadgetPosition(p,true); popActionList->LFSTK_freeList(); @@ -49,7 +51,10 @@ bool launcherEnterCB(LFSTK_gadgetClass*p,void* ud) popActionList->LFSTK_moveGadget(-1,-1); popActionWindow->userData=USERDATA(LAUNCHER); popActionWindow->LFSTK_resizeWindow(popActionList->LFSTK_getListMaxWidth()-2,GADGETHITE-2); + + p->contextYOffset=popActionWindowYOffset; showhidetActionList(p,popActionWindow,popActionList); + inSomeWindow=true; } return(true); @@ -62,6 +67,7 @@ bool launcherExitCB(LFSTK_gadgetClass *p,void* ud) setGadgetPosition(p,false); inSomeWindow=false; popActionListExitCB(NULL,(void*)1); + dockWindow->LFSTK_clearWindow(true); } return(true); } @@ -79,6 +85,7 @@ bool launcherCB(void *p,void* ud) propReturn pr; showhidetActionList(NULL,popActionWindow,popActionList); + XSync(apc->display,false); if(p!=NULL) { @@ -191,17 +198,10 @@ int addLaunchers(int x,int y,int grav) findlaunchers->LFSTK_findFiles(launchersDir.c_str(),false); findlaunchers->LFSTK_sortByName(); - win=new windowInitStruct;//TODO// - win->app=apc; - win->windowName=""; - win->loadVars=true; - win->x=100; - win->y=100; - win->w=200; - win->h=200; + win=apc->LFSTK_getDefaultWInit(); + win->windowName="X"; win->wc=dockWindow; win->windowType=apc->appAtomsHashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_MENU")); - win->app=apc; win->decorated=false; win->overRide=true; win->level=ABOVEALL; @@ -209,7 +209,6 @@ int addLaunchers(int x,int y,int grav) apc->LFSTK_addWindow(win,""); launcherContextWindow=apc->windows->back().window; launcherContextWindow->LFSTK_setWindowColourName(NORMALCOLOUR,lc.c_str()); - for(int j=BUTTONLAUNCH;jLFSTK_setContextWindow(launcherContextWindow); + if(dockGravity==PANELSOUTH) bc->contextWindowPos=CONTEXTABOVECENTRE; else diff --git a/LFSDock/LFSDock/src/main.cpp b/LFSDock/LFSDock/src/main.cpp index ed97e8a..f111537 100644 --- a/LFSDock/LFSDock/src/main.cpp +++ b/LFSDock/LFSDock/src/main.cpp @@ -123,28 +123,7 @@ bool windowDrop(LFSTK_windowClass *lwc,void* ud) void sanityCheck(void) { namespace fs=std::filesystem; -// namespace fsfs=std::experimental::filesystem; -// -// -//for (fsfs::path p : {"/var/tmp/example.txt", "/", "/var/tmp/."}) -// std::cout << "The parent path of " << p -// << " is " << p.parent_path() << '\n'; -//// -///* -//#include -//#include -//namespace fs = std::experimental::filesystem; -// -//*/ -////fsfs=launchersDir; -// fsfs::path p1; -// p1=launchersDir; -////c=launchersDir; -//std::cout<popupFromGadget=gadget; gadget->LFSTK_getGeomWindowRelative(&geom,gadget->wc->app->rootWindow); + geom.x+=gadget->contextXOffset; + geom.y+=gadget->contextYOffset; switch(gadget->contextWindowPos) { case CONTEXTLEFT: diff --git a/LFSToolKit/LFSToolKit/lfstk/LFSTKLineEdit.cpp b/LFSToolKit/LFSToolKit/lfstk/LFSTKLineEdit.cpp index fd39697..7fc4d4b 100644 --- a/LFSToolKit/LFSToolKit/lfstk/LFSTKLineEdit.cpp +++ b/LFSToolKit/LFSToolKit/lfstk/LFSTKLineEdit.cpp @@ -292,12 +292,12 @@ void LFSTK_lineEditClass::drawLabel(void) { int startchar=0; double yoffset=0; - cairo_text_extents_t partextents; - char *data; - char undercurs[2]={0,0}; - char *aftercursor; + cairo_text_extents_t partextents; + char *data; + char undercurs[2]={0,0}; + char *aftercursor; int maxchars; - cairo_text_extents_t charextents; + cairo_text_extents_t charextents; cairo_save(this->cr); cairo_reset_clip(this->cr); diff --git a/LFSToolKit/LFSToolKit/lfstk/LFSTKMultiLineEdit.cpp b/LFSToolKit/LFSToolKit/lfstk/LFSTKMultiLineEdit.cpp index f3df11f..d7eb390 100644 --- a/LFSToolKit/LFSToolKit/lfstk/LFSTKMultiLineEdit.cpp +++ b/LFSToolKit/LFSToolKit/lfstk/LFSTKMultiLineEdit.cpp @@ -227,6 +227,7 @@ void LFSTK_multiLineEditClass::drawText(void) cairo_save(this->cr); cairo_reset_clip(this->cr); 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); + cairo_set_operator(this->cr,CAIRO_OPERATOR_SOURCE); cairo_paint(this->cr); cairo_restore(this->cr); diff --git a/LFSToolKit/examples/basic.cpp b/LFSToolKit/examples/basic.cpp index a9799d9..22a8a2d 100755 --- a/LFSToolKit/examples/basic.cpp +++ b/LFSToolKit/examples/basic.cpp @@ -289,7 +289,7 @@ int main(int argc, char **argv) apc->LFSTK_setTimer(1000000,true); apc->LFSTK_setTimerCallBack(timerCB,NULL); - 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); + 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); LFSTK_labelClass *poplabel=new LFSTK_labelClass(popWindow,"This is a mouse enter callback",0,0,GADGETWIDTH*8,GADGETHITE,WestGravity); poplabel->LFSTK_setCairoFontDataParts("sB",20); diff --git a/LFSToolKit/examples/image.cpp b/LFSToolKit/examples/image.cpp index 41ac0fb..3bc3d36 100755 --- a/LFSToolKit/examples/image.cpp +++ b/LFSToolKit/examples/image.cpp @@ -166,7 +166,7 @@ int main(int argc, char **argv) win->w=200; win->h=200; win->wc=wc; - win->windowType=apc->appAtomsHashed.at(apc->globalLib->prefs.LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_TOOL")); + win->windowType=apc->appAtomsHashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_TOOL")); win->decorated=false; win->overRide=true; diff --git a/LFSToolKit/examples/lineedit.cpp b/LFSToolKit/examples/lineedit.cpp index 4f5124b..7e9da03 100755 --- a/LFSToolKit/examples/lineedit.cpp +++ b/LFSToolKit/examples/lineedit.cpp @@ -101,7 +101,10 @@ int main(int argc, char **argv) hrs.back().gadget->LFSTK_setMouseCallBack(NULL,doMouseUp,NULL); hrs.back().gadget->LFSTK_setKeyCallBack(NULL,doKeyUp,USERDATA(12345)); hrs.back().gadget->LFSTK_setGadgetDropCallBack(doDropped); - //hrs.back().gadget->LFSTK_setAlpha(0.9); + + + //hrs.back().gadget->LFSTK_setAlpha(0.2); + //hrs.back().gadget->LFSTK_setGadgetColourPair(NORMALCOLOUR,"#20ff00ff","#20000000"); //hrs.back().gadget->LFSTK_setColourName(NORMALCOLOUR,"#e0ffffff"); //printf(">>>>hrs.back().gadget=%p\n",hrs.back().gadget); static_cast(hrs.back().gadget)->LFSTK_setCallbackOnReturn(false); diff --git a/LFSToolKit/examples/multilineedit.cpp b/LFSToolKit/examples/multilineedit.cpp index f1d2f00..25aa62d 100755 --- a/LFSToolKit/examples/multilineedit.cpp +++ b/LFSToolKit/examples/multilineedit.cpp @@ -97,6 +97,8 @@ int main(int argc, char **argv) //line edit editbox=new LFSTK_multiLineEditClass(wc,test_string,BORDER,sy,DIALOGWIDTH-BORDER-BORDER,GADGETHITE*10,BUTTONGRAV); + //editbox->LFSTK_setGadgetColourPair(NORMALCOLOUR,"#c0ffffff","#ff000000"); + //editbox->LFSTK_setAlpha(0.0); sy+=YSPACING+(GADGETHITE*10); diff --git a/LFSToolKit/examples/toggle.cpp b/LFSToolKit/examples/toggle.cpp index 86b7fbd..012876a 100755 --- a/LFSToolKit/examples/toggle.cpp +++ b/LFSToolKit/examples/toggle.cpp @@ -144,7 +144,7 @@ int main(int argc, char **argv) win->decorated=false; win->overRide=true; win->app=apc; - win->windowType=apc->appAtomsHashed.at(apc->globalLib->prefs.LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_TOOL")); + win->windowType=apc->appAtomsHashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_TOOL")); apc->LFSTK_addToolWindow(win); scwindow=apc->windows->back().window;//TODO// vsb=new LFSTK_scrollBarClass(scwindow,true,0,0,16,100);