mirror of https://github.com/davatorium/rofi.git
Fix rendering of boxes (margin and height)
This commit is contained in:
parent
eae9fe7f04
commit
d290285a9f
|
@ -9,6 +9,7 @@
|
||||||
- Better way to determine font height.
|
- Better way to determine font height.
|
||||||
- Fix font vertical centering.
|
- Fix font vertical centering.
|
||||||
- One-off when pasting text.
|
- One-off when pasting text.
|
||||||
|
- Improve rendering of boxes (fixed height and margins)
|
||||||
Cleanup:
|
Cleanup:
|
||||||
- Do not lug argc,argv around everywhere.
|
- Do not lug argc,argv around everywhere.
|
||||||
|
|
||||||
|
|
|
@ -149,7 +149,6 @@ ScriptOptions *script_switcher_parse_setup ( const char *str )
|
||||||
char *endp = NULL;
|
char *endp = NULL;
|
||||||
char *parse = g_strdup ( str );
|
char *parse = g_strdup ( str );
|
||||||
unsigned int index = 0;
|
unsigned int index = 0;
|
||||||
// TODO: This is naive and can be improved.
|
|
||||||
for ( char *token = strtok_r ( parse, ":", &endp ); token != NULL; token = strtok_r ( NULL, ":", &endp ) ) {
|
for ( char *token = strtok_r ( parse, ":", &endp ); token != NULL; token = strtok_r ( NULL, ":", &endp ) ) {
|
||||||
if ( index == 0 ) {
|
if ( index == 0 ) {
|
||||||
sw->name = g_strdup ( token );
|
sw->name = g_strdup ( token );
|
||||||
|
|
|
@ -886,9 +886,9 @@ static void menu_update ( MenuState *state )
|
||||||
if ( config.sidebar_mode == TRUE ) {
|
if ( config.sidebar_mode == TRUE ) {
|
||||||
XDrawLine ( display, main_window, gc,
|
XDrawLine ( display, main_window, gc,
|
||||||
( config.padding ),
|
( config.padding ),
|
||||||
state->h - state->line_height - ( config.padding ) - 1,
|
state->h - state->line_height - ( config.padding ) - 1 - LINE_MARGIN,
|
||||||
state->w - ( ( config.padding ) ) - 1,
|
state->w - ( ( config.padding ) ) - 1,
|
||||||
state->h - state->line_height - ( config.padding ) - 1 );
|
state->h - state->line_height - ( config.padding ) - 1 - LINE_MARGIN );
|
||||||
for ( unsigned int j = 0; j < num_switchers; j++ ) {
|
for ( unsigned int j = 0; j < num_switchers; j++ ) {
|
||||||
textbox_draw ( switchers[j].tb );
|
textbox_draw ( switchers[j].tb );
|
||||||
}
|
}
|
||||||
|
@ -976,20 +976,20 @@ MenuReturn menu ( char **lines, unsigned int num_lines, char **input, char *prom
|
||||||
menu_calculate_window_and_element_width ( &state, &mon );
|
menu_calculate_window_and_element_width ( &state, &mon );
|
||||||
|
|
||||||
// Prompt box.
|
// Prompt box.
|
||||||
state.prompt_tb = textbox_create ( main_window, &vinfo, map, TB_AUTOHEIGHT | TB_AUTOWIDTH,
|
state.prompt_tb = textbox_create ( main_window, &vinfo, map, TB_AUTOWIDTH,
|
||||||
( config.padding ),
|
( config.padding ),
|
||||||
( config.padding ),
|
( config.padding ),
|
||||||
0, 0, NORMAL, prompt );
|
0, state.line_height, NORMAL, prompt );
|
||||||
// Entry box
|
// Entry box
|
||||||
int entrybox_width = state.w
|
int entrybox_width = state.w
|
||||||
- ( 2 * ( config.padding ) )
|
- ( 2 * ( config.padding ) )
|
||||||
- textbox_get_width ( state.prompt_tb )
|
- textbox_get_width ( state.prompt_tb )
|
||||||
- textbox_get_width ( state.case_indicator );
|
- textbox_get_width ( state.case_indicator );
|
||||||
|
|
||||||
state.text = textbox_create ( main_window, &vinfo, map, TB_AUTOHEIGHT | TB_EDITABLE,
|
state.text = textbox_create ( main_window, &vinfo, map, TB_EDITABLE,
|
||||||
( config.padding ) + textbox_get_width ( state.prompt_tb ),
|
( config.padding ) + textbox_get_width ( state.prompt_tb ),
|
||||||
( config.padding ),
|
( config.padding ),
|
||||||
entrybox_width, 0,
|
entrybox_width, state.line_height,
|
||||||
NORMAL,
|
NORMAL,
|
||||||
*input );
|
*input );
|
||||||
// Move indicator to end.
|
// Move indicator to end.
|
||||||
|
@ -1047,7 +1047,7 @@ MenuReturn menu ( char **lines, unsigned int num_lines, char **input, char *prom
|
||||||
|
|
||||||
// Add entry
|
// Add entry
|
||||||
if ( config.sidebar_mode == TRUE ) {
|
if ( config.sidebar_mode == TRUE ) {
|
||||||
state.h += state.line_height + LINE_MARGIN;
|
state.h += state.line_height + LINE_MARGIN * 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sidebar mode.
|
// Sidebar mode.
|
||||||
|
|
Loading…
Reference in New Issue