// First determine if the palette must be shown on the left or on the right
if(desktopPalettePos.x()<=(mTransparentDrawingView->width()-(palette->width()+mDesktopPalette->width()+20)))// we take a small margin of 20 pixels
if(desktopPalettePos.x()<=(mTransparentDrawingView->width()-(palette->width()+mDesktopPalette->width()+mRightPalette->width()+20)))// we take a small margin of 20 pixels