mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-05 20:45:49 +01:00
Draw focus differently in tray if whole thing has it, to include borders
between the tiles.
This commit is contained in:
parent
74ccc0ed34
commit
b23d51fba4
3 changed files with 24 additions and 10 deletions
|
@ -615,6 +615,7 @@ palm_bnw_draw_trayBegin( DrawCtx* p_dctx, const XP_Rect* rect,
|
||||||
|
|
||||||
WinGetClip( &dctx->oldTrayClip );
|
WinGetClip( &dctx->oldTrayClip );
|
||||||
WinSetClip( (RectangleType*)rect );
|
WinSetClip( (RectangleType*)rect );
|
||||||
|
dctx->topFocus = dfs == DFS_TOP;
|
||||||
return XP_TRUE;
|
return XP_TRUE;
|
||||||
} /* palm_bnw_draw_trayBegin */
|
} /* palm_bnw_draw_trayBegin */
|
||||||
|
|
||||||
|
@ -647,27 +648,33 @@ palm_draw_drawTile( DrawCtx* p_dctx, const XP_Rect* rect,
|
||||||
XP_U16 len, width;
|
XP_U16 len, width;
|
||||||
XP_U16 doubler = 1;
|
XP_U16 doubler = 1;
|
||||||
const XP_Bool cursor = (flags & CELL_ISCURSOR) != 0;
|
const XP_Bool cursor = (flags & CELL_ISCURSOR) != 0;
|
||||||
IndexedColorType oclr = 0;
|
|
||||||
XP_Bool empty = (flags & CELL_ISEMPTY) != 0;
|
XP_Bool empty = (flags & CELL_ISEMPTY) != 0;
|
||||||
|
|
||||||
|
WinPushDrawState();
|
||||||
|
|
||||||
if ( dctx->doHiRes ) {
|
if ( dctx->doHiRes ) {
|
||||||
doubler = 2;
|
doubler = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
draw_clearRect( p_dctx, &localR );
|
draw_clearRect( p_dctx, &localR );
|
||||||
|
|
||||||
|
if ( dctx->topFocus || cursor ) {
|
||||||
|
(void)WinSetBackColor( dctx->drawingPrefs->drawColors[COLOR_CURSOR] );
|
||||||
|
if ( dctx->topFocus ) {
|
||||||
|
WinEraseRectangle( (const RectangleType*)&localR, 0 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
localR.height -= 3 * doubler;
|
localR.height -= 3 * doubler;
|
||||||
localR.top += 2 * doubler;
|
localR.top += 2 * doubler;
|
||||||
|
localR.width -= 3 * doubler;
|
||||||
|
localR.left += 2 * doubler;
|
||||||
|
|
||||||
if ( cursor ) {
|
if ( cursor && !dctx->topFocus ) {
|
||||||
oclr = WinSetBackColor( dctx->drawingPrefs->drawColors[COLOR_CURSOR] );
|
|
||||||
/* this will fill it with the tile background color */
|
/* this will fill it with the tile background color */
|
||||||
WinEraseRectangle( (const RectangleType*)&localR, 0 );
|
WinEraseRectangle( (const RectangleType*)&localR, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
localR.width -= 3 * doubler;
|
|
||||||
localR.left += 2 * doubler;
|
|
||||||
|
|
||||||
/* this will fill it with the tile background color */
|
/* this will fill it with the tile background color */
|
||||||
if ( !empty && !cursor ) {
|
if ( !empty && !cursor ) {
|
||||||
WinEraseRectangle( (const RectangleType*)&localR, 0 );
|
WinEraseRectangle( (const RectangleType*)&localR, 0 );
|
||||||
|
@ -723,10 +730,7 @@ palm_draw_drawTile( DrawCtx* p_dctx, const XP_Rect* rect,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
WinPopDrawState();
|
||||||
if ( cursor ) {
|
|
||||||
WinSetBackColor( oclr );
|
|
||||||
}
|
|
||||||
} /* palm_draw_drawTile */
|
} /* palm_draw_drawTile */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -2570,6 +2570,15 @@ mainViewHandleEvent( EventPtr event )
|
||||||
}
|
}
|
||||||
if ( xpkey != XP_KEY_NONE ) {
|
if ( xpkey != XP_KEY_NONE ) {
|
||||||
draw = board_handleKey( globals->game.board, xpkey, &handled );
|
draw = board_handleKey( globals->game.board, xpkey, &handled );
|
||||||
|
/* If handled comes back false yet something changed (draw),
|
||||||
|
we'll be getting another event shortly. Put the draw off
|
||||||
|
until then so we don't flash the tray focussed then not. This
|
||||||
|
is a hack, but I can't think of a way to integrate it into
|
||||||
|
board.c logic without making too many palm-centric assumptions
|
||||||
|
there. */
|
||||||
|
if ( draw && !handled ) {
|
||||||
|
draw = XP_FALSE;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
/* remove this and break focus drilldown. Why? */
|
/* remove this and break focus drilldown. Why? */
|
||||||
handled = draw;
|
handled = draw;
|
||||||
|
|
|
@ -85,6 +85,7 @@ typedef struct PalmDrawCtx {
|
||||||
UInt16 oldCoord;
|
UInt16 oldCoord;
|
||||||
XP_Bool doHiRes;
|
XP_Bool doHiRes;
|
||||||
XP_Bool oneDotFiveAvail;
|
XP_Bool oneDotFiveAvail;
|
||||||
|
XP_Bool topFocus;
|
||||||
|
|
||||||
XP_LangCode fontLangCode;
|
XP_LangCode fontLangCode;
|
||||||
PalmFontHtInfo* fontHtInfo;
|
PalmFontHtInfo* fontHtInfo;
|
||||||
|
|
Loading…
Add table
Reference in a new issue