@@ -478,20 +478,17 @@ static void get_gtk_theme(const bool dont_query_dewm, const std::uint8_t ver, co
478
478
// clang-format off
479
479
Theme::Theme (const std::uint8_t ver, systemInfo_t& queried_themes,
480
480
const std::string& theme_name_version, const Config& config, const bool gsettings_only)
481
+ : m_theme_name(theme_name_version),
482
+ m_queried_themes(queried_themes)
481
483
{
482
484
if (queried_themes.find (theme_name_version) != queried_themes.end ())
483
- {
484
- m_theme_infos.gtk_theme_name = getInfoFromName (queried_themes, theme_name_version, " theme-name" );
485
- m_theme_infos.gtk_font = getInfoFromName (queried_themes, theme_name_version, " icon-theme-name" );
486
- m_theme_infos.gtk_icon_theme = getInfoFromName (queried_themes, theme_name_version, " font-name" );
487
485
return ;
488
- }
489
486
490
487
const std::string& wm_name = query_user.wm_name (query_user.m_bDont_query_dewm , query_user.term_name ());
491
488
const std::string& de_name = query_user.de_name (query_user.m_bDont_query_dewm , query_user.term_name (), wm_name);
492
489
493
490
if (((de_name != MAGIC_LINE && wm_name != MAGIC_LINE) &&
494
- de_name == wm_name) || de_name == MAGIC_LINE)
491
+ de_name == wm_name) || de_name == MAGIC_LINE)
495
492
m_wmde_name = wm_name;
496
493
else
497
494
m_wmde_name = de_name;
@@ -507,8 +504,8 @@ Theme::Theme(const std::uint8_t ver, systemInfo_t& queried_themes,
507
504
if (m_theme_infos.gtk_icon_theme .empty ())
508
505
m_theme_infos.gtk_icon_theme = MAGIC_LINE;
509
506
510
- queried_themes .insert (
511
- {theme_name_version , {
507
+ m_queried_themes .insert (
508
+ {m_theme_name , {
512
509
{" theme-name" , variant (m_theme_infos.gtk_theme_name )},
513
510
{" icon-theme-name" , variant (m_theme_infos.gtk_icon_theme )},
514
511
{" font-name" , variant (m_theme_infos.gtk_font )},
@@ -517,7 +514,7 @@ Theme::Theme(const std::uint8_t ver, systemInfo_t& queried_themes,
517
514
}
518
515
519
516
// only use it for cursor
520
- Theme::Theme (const Config& config, const bool gsettings_only)
517
+ Theme::Theme (systemInfo_t& queried_themes, const Config& config, const bool gsettings_only) : m_queried_themes(queried_themes )
521
518
{
522
519
const std::string& wm_name = query_user.wm_name (query_user.m_bDont_query_dewm , query_user.term_name ());
523
520
const std::string& de_name = query_user.de_name (query_user.m_bDont_query_dewm , query_user.term_name (), wm_name);
@@ -551,14 +548,14 @@ Theme::Theme(const Config& config, const bool gsettings_only)
551
548
552
549
}
553
550
554
- std::string& Theme::gtk_theme () noexcept
555
- { return m_theme_infos. gtk_theme_name ; }
551
+ std::string Theme::gtk_theme () noexcept
552
+ { return getInfoFromName (m_queried_themes, m_theme_name, " theme-name " ) ; }
556
553
557
- std::string& Theme::gtk_icon_theme () noexcept
558
- { return m_theme_infos. gtk_icon_theme ; }
554
+ std::string Theme::gtk_icon_theme () noexcept
555
+ { return getInfoFromName (m_queried_themes, m_theme_name, " icon-theme-name " ) ; }
559
556
560
- std::string& Theme::gtk_font () noexcept
561
- { return m_theme_infos. gtk_font ; }
557
+ std::string Theme::gtk_font () noexcept
558
+ { return getInfoFromName (m_queried_themes, m_theme_name, " font-name " ) ; }
562
559
563
560
std::string& Theme::cursor () noexcept
564
561
{ return m_theme_infos.cursor ; }
0 commit comments