summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorDave Davenport <qball@blame.services>2021-06-08 22:33:23 +0200
committerDave Davenport <qball@blame.services>2021-06-08 22:33:23 +0200
commit1a9dac80a9a39d5f71f204710c1b07057d805ead (patch)
treef58587d31a01091de03e301e413ffa86e9ba3448 /source
parentb478de3d7da950de9c19a15ad551488a379bf8e3 (diff)
Remove some deprecated options.
* lines * columns * width
Diffstat (limited to 'source')
-rw-r--r--source/dialogs/dmenu.c14
-rw-r--r--source/dialogs/window.c5
-rw-r--r--source/helper.c11
-rw-r--r--source/rofi-icon-fetcher.c7
-rw-r--r--source/view.c13
-rw-r--r--source/widgets/listview.c4
-rw-r--r--source/xrmoptions.c7
7 files changed, 25 insertions, 36 deletions
diff --git a/source/dialogs/dmenu.c b/source/dialogs/dmenu.c
index 896ce863..b8ae41fe 100644
--- a/source/dialogs/dmenu.c
+++ b/source/dialogs/dmenu.c
@@ -388,7 +388,19 @@ static int dmenu_mode_init ( Mode *sw )
}
// DMENU COMPATIBILITY
- find_arg_uint ( "-l", &( config.menu_lines ) );
+ unsigned int lines = DEFAULT_MENU_LINES;
+ find_arg_uint ( "-l", &( lines ) );
+ if ( lines != DEFAULT_MENU_LINES ) {
+ Property *p = rofi_theme_property_create ( P_INTEGER );
+ p->name = g_strdup("lines");
+ p->value.i = lines;
+ ThemeWidget *widget = rofi_theme_find_or_create_name ( rofi_theme, "listview" );
+ GHashTable *table = g_hash_table_new_full ( g_str_hash, g_str_equal, NULL, (GDestroyNotify) rofi_theme_property_free );
+
+ g_hash_table_replace ( table, p->name, p );
+ rofi_theme_widget_add_properties ( widget, table );
+ g_hash_table_destroy ( table );
+ }
str = NULL;
find_arg_str ( "-window-title", &str );
diff --git a/source/dialogs/window.c b/source/dialogs/window.c
index 289ed9c7..de1e9240 100644
--- a/source/dialogs/window.c
+++ b/source/dialogs/window.c
@@ -109,7 +109,7 @@ typedef struct
long hint_flags;
uint32_t wmdesktop;
char *wmdesktopstr;
- int wmdesktopstr_len;
+ unsigned int wmdesktopstr_len;
cairo_surface_t *icon;
gboolean icon_checked;
uint32_t icon_fetch_uid;
@@ -790,9 +790,6 @@ static gboolean helper_eval_cb ( const GMatchInfo *info, GString *str, gpointer
int l = 0;
if ( match[2] == ':' ) {
l = (int) g_ascii_strtoll ( &match[3], NULL, 10 );
- if ( l < 0 && config.menu_width < 0 ) {
- l = -config.menu_width + l;
- }
if ( l < 0 ) {
l = 0;
}
diff --git a/source/helper.c b/source/helper.c
index 3e5eb702..7a947fb5 100644
--- a/source/helper.c
+++ b/source/helper.c
@@ -661,17 +661,6 @@ int config_sanity_check ( void )
config.element_height = 1;
found_error = TRUE;
}
- if ( config.menu_columns == 0 ) {
- g_string_append_printf ( msg, "\t<b>config.menu_columns</b>=%d is invalid. You need at least one visible column.\n",
- config.menu_columns );
- config.menu_columns = 1;
- found_error = TRUE;
- }
- if ( config.menu_width == 0 ) {
- g_string_append_printf ( msg, "<b>config.menu_width</b>=0 is invalid. You cannot have a window with no width." );
- config.menu_columns = 50;
- found_error = TRUE;
- }
if ( !( config.location >= 0 && config.location <= 8 ) ) {
g_string_append_printf ( msg, "\t<b>config.location</b>=%d is invalid. Value should be between %d and %d.\n",
config.location, 0, 8 );
diff --git a/source/rofi-icon-fetcher.c b/source/rofi-icon-fetcher.c
index 2e443578..58c5fe99 100644
--- a/source/rofi-icon-fetcher.c
+++ b/source/rofi-icon-fetcher.c
@@ -140,6 +140,11 @@ void rofi_icon_fetcher_init ( void )
g_slist_free ( l );
}
+static void free_wrapper ( gpointer data, G_GNUC_UNUSED gpointer user_data )
+{
+ g_free ( data ) ;
+}
+
void rofi_icon_fetcher_destroy ( void )
{
if ( rofi_icon_fetcher_data == NULL ) {
@@ -151,7 +156,7 @@ void rofi_icon_fetcher_destroy ( void )
g_hash_table_unref ( rofi_icon_fetcher_data->icon_cache_uid );
g_hash_table_unref ( rofi_icon_fetcher_data->icon_cache );
- g_list_foreach ( rofi_icon_fetcher_data->supported_extensions, (GFunc) g_free, NULL );
+ g_list_foreach ( rofi_icon_fetcher_data->supported_extensions, free_wrapper, NULL );
g_list_free ( rofi_icon_fetcher_data->supported_extensions );
g_free ( rofi_icon_fetcher_data );
}
diff --git a/source/view.c b/source/view.c
index f09cd560..7a70823d 100644
--- a/source/view.c
+++ b/source/view.c
@@ -918,15 +918,8 @@ static void rofi_view_calculate_window_width ( RofiViewState *state )
state->width = CacheState.mon.w;
return;
}
- if ( config.menu_width < 0 ) {
- double fw = textbox_get_estimated_char_width ( );
- state->width = -( fw * config.menu_width );
- state->width += widget_padding_get_padding_width ( WIDGET ( state->main_window ) );
- }
- else{
- // Calculate as float to stop silly, big rounding down errors.
- state->width = config.menu_width < 101 ? ( CacheState.mon.w / 100.0f ) * ( float ) config.menu_width : config.menu_width;
- }
+ // Calculate as float to stop silly, big rounding down errors.
+ state->width = ( CacheState.mon.w / 100.0f ) * DEFAULT_MENU_WIDTH;
// Use theme configured width, if set.
RofiDistance width = rofi_theme_get_distance ( WIDGET ( state->main_window ), "width", state->width );
state->width = distance_get_pixel ( width, ROFI_ORIENTATION_HORIZONTAL );
@@ -1853,7 +1846,7 @@ static void rofi_view_add_widget ( RofiViewState *state, widget *parent_widget,
listview_set_scroll_type ( state->list_view, config.scroll_method );
listview_set_mouse_activated_cb ( state->list_view, rofi_view_listview_mouse_activated_cb, state );
- int lines = rofi_theme_get_integer ( WIDGET ( state->list_view ), "lines", config.menu_lines );
+ int lines = rofi_theme_get_integer ( WIDGET ( state->list_view ), "lines", DEFAULT_MENU_LINES );
listview_set_num_lines ( state->list_view, lines );
listview_set_max_lines ( state->list_view, state->num_lines );
}
diff --git a/source/widgets/listview.c b/source/widgets/listview.c
index 352f93ed..893f24de 100644
--- a/source/widgets/listview.c
+++ b/source/widgets/listview.c
@@ -521,7 +521,7 @@ void listview_set_num_elements ( listview *lv, unsigned int rows )
if ( lv == NULL ) {
return;
}
- TICK_N ( __FUNCTION__ );
+ TICK_N ( "listview_set_num_elements" );
lv->req_elements = rows;
listview_set_selected ( lv, lv->selected );
TICK_N ( "Set selected" );
@@ -696,7 +696,7 @@ listview *listview_create ( widget *parent, const char *name, listview_update_ca
// Some settings.
lv->spacing = rofi_theme_get_distance ( WIDGET ( lv ), "spacing", DEFAULT_SPACING );
- lv->menu_columns = rofi_theme_get_integer ( WIDGET ( lv ), "columns", config.menu_columns );
+ lv->menu_columns = rofi_theme_get_integer ( WIDGET ( lv ), "columns", DEFAULT_MENU_COLUMNS);
lv->fixed_num_lines = rofi_theme_get_boolean ( WIDGET ( lv ), "fixed-height", config.fixed_num_lines );
lv->dynamic = rofi_theme_get_boolean ( WIDGET ( lv ), "dynamic", TRUE );
lv->reverse = rofi_theme_get_boolean ( WIDGET ( lv ), "reverse", reverse );
diff --git a/source/xrmoptions.c b/source/xrmoptions.c
index 775b71ab..d76cd1fa 100644
--- a/source/xrmoptions.c
+++ b/source/xrmoptions.c
@@ -86,13 +86,6 @@ static XrmOption xrmOptions[] = {
"", CONFIG_DEFAULT },
{ xrm_String, "modi", { .str = &config.modi }, NULL,
"Enabled modi", CONFIG_DEFAULT },
- { xrm_SNumber, "width", { .snum = &config.menu_width }, NULL,
- "Window width", CONFIG_DEFAULT },
- { xrm_Number, "lines", { .num = &config.menu_lines }, NULL,
- "Number of lines", CONFIG_DEFAULT },
- { xrm_Number, "columns", { .num = &config.menu_columns }, NULL,
- "Number of columns", CONFIG_DEFAULT },
-
{ xrm_String, "font", { .str = &config.menu_font }, NULL,
"Font to use", CONFIG_DEFAULT },
{ xrm_Number, "location", { .num = &config.location }, NULL,