mirror of
https://github.com/davatorium/rofi.git
synced 2024-11-11 13:50:48 -05:00
[OldTheme] Re-add the padding/bw option.
This commit is contained in:
parent
5f21ab80a8
commit
7e1c02b04c
7 changed files with 25 additions and 3 deletions
|
@ -35,6 +35,8 @@ Settings config = {
|
|||
/** List of enabled modi. */
|
||||
/** -modi */
|
||||
.modi = "window,run,ssh",
|
||||
/** Border width around the window. */
|
||||
.menu_bw = 1,
|
||||
/** The width of the switcher. (0100 in % > 100 in pixels) */
|
||||
.menu_width = 50,
|
||||
/** Maximum number of options to show. */
|
||||
|
@ -74,6 +76,8 @@ Settings config = {
|
|||
*
|
||||
*/
|
||||
.location = WL_CENTER,
|
||||
/** Padding between elements */
|
||||
.padding = 5,
|
||||
/** Y offset */
|
||||
.y_offset = 0,
|
||||
/** X offset */
|
||||
|
|
|
@ -82,6 +82,8 @@ typedef struct
|
|||
{
|
||||
/** List of enabled modi */
|
||||
char *modi;
|
||||
/** Border width */
|
||||
unsigned int menu_bw;
|
||||
/** Width (0-100 in %, > 100 in pixels, < 0 in char width.) */
|
||||
int menu_width;
|
||||
/** # lines */
|
||||
|
@ -119,6 +121,8 @@ typedef struct
|
|||
|
||||
/** Windows location/gravity */
|
||||
WindowLocation location;
|
||||
/** Padding between elements */
|
||||
unsigned int padding;
|
||||
/** Y offset */
|
||||
int y_offset;
|
||||
/** X offset */
|
||||
|
|
|
@ -185,7 +185,7 @@ static void exec_cmd_entry ( DRunModeEntry *e )
|
|||
}
|
||||
|
||||
const gchar *fp = g_strstrip ( str );
|
||||
gchar *exec_path = g_key_file_get_string ( e->key_file, "Desktop Entry", "Path", NULL );
|
||||
gchar *exec_path = g_key_file_get_string ( e->key_file, "Desktop Entry", "Path", NULL );
|
||||
if ( exec_path != NULL && strlen ( exec_path ) == 0 ) {
|
||||
// If it is empty, ignore this property. (#529)
|
||||
g_free ( exec_path );
|
||||
|
|
|
@ -1103,7 +1103,7 @@ cairo_surface_t* cairo_image_surface_create_from_svg ( const gchar* file, int he
|
|||
g_object_unref ( handle );
|
||||
|
||||
/** Rendering fails */
|
||||
if ( G_UNLIKELY ( failed ) ){
|
||||
if ( G_UNLIKELY ( failed ) ) {
|
||||
g_warning ( "Failed to render file: '%s'", file );
|
||||
cairo_surface_destroy ( surface );
|
||||
surface = NULL;
|
||||
|
|
|
@ -796,15 +796,18 @@ int main ( int argc, char *argv[] )
|
|||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
TICK_N ( "Setup Locale" );
|
||||
rofi_collect_modi ();
|
||||
rofi_collect_modi_setup ();
|
||||
TICK_N ( "Collect MODI" );
|
||||
rofi_collect_modi_setup ();
|
||||
TICK_N ( "Setup MODI" );
|
||||
|
||||
main_loop = g_main_loop_new ( NULL, FALSE );
|
||||
|
||||
TICK_N ( "Setup mainloop" );
|
||||
|
||||
bindings = nk_bindings_new ();
|
||||
TICK_N ( "NK Bindings" );
|
||||
|
||||
if ( !display_setup ( main_loop, bindings ) ) {
|
||||
g_warning ( "Connection has error" );
|
||||
|
|
|
@ -691,6 +691,11 @@ static char * rofi_theme_convert_color ( char *col )
|
|||
}
|
||||
void rofi_theme_convert_old ( void )
|
||||
{
|
||||
{
|
||||
char *str = g_strdup_printf ( "#window { border: %d; padding: %d;}", config.menu_bw, config.padding );
|
||||
rofi_theme_parse_string ( str );
|
||||
g_free ( str );
|
||||
}
|
||||
if ( config.color_window ) {
|
||||
char **retv = g_strsplit ( config.color_window, ",", -1 );
|
||||
const char * const conf[] = {
|
||||
|
|
|
@ -94,10 +94,16 @@ static XrmOption xrmOptions[] = {
|
|||
|
||||
{ xrm_String, "font", { .str = &config.menu_font }, NULL,
|
||||
"Font to use", CONFIG_DEFAULT },
|
||||
{ xrm_Number, "borderwidth", { .num = &config.menu_bw }, NULL,
|
||||
"", CONFIG_DEFAULT },
|
||||
{ xrm_Number, "bw", { .num = &config.menu_bw }, NULL,
|
||||
"Border width", CONFIG_DEFAULT },
|
||||
|
||||
{ xrm_Number, "location", { .num = &config.location }, NULL,
|
||||
"Location on screen", CONFIG_DEFAULT },
|
||||
|
||||
{ xrm_Number, "padding", { .num = &config.padding }, NULL,
|
||||
"Padding", CONFIG_DEFAULT },
|
||||
{ xrm_SNumber, "yoffset", { .snum = &config.y_offset }, NULL,
|
||||
"Y-offset relative to location", CONFIG_DEFAULT },
|
||||
{ xrm_SNumber, "xoffset", { .snum = &config.x_offset }, NULL,
|
||||
|
|
Loading…
Reference in a new issue