-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Icon themes: Active-Directory (line, duotone, color) #425
base: master
Are you sure you want to change the base?
Conversation
6ef91ea
to
066da7d
Compare
@@ -341,7 +342,10 @@ void console_query_tree_init(ConsoleWidget *console) { | |||
const QList<QStandardItem *> root_row = console->add_scope_item(ItemType_QueryFolder, QModelIndex()); | |||
auto root = root_row[0]; | |||
root->setText(QCoreApplication::translate("query", "Saved Queries")); | |||
root->setIcon(QIcon::fromTheme("folder")); | |||
|
|||
const QIcon create_query_folder_icon = g_icon_manager->get_object_icon("folder-query"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not related to the commit topic. Better move to another commit or create refactor branch
@@ -533,7 +537,9 @@ QModelIndex console_query_folder_create(ConsoleWidget *console, const QString &n | |||
void console_query_folder_load(const QList<QStandardItem *> &row, const QString &name, const QString &description) { | |||
QStandardItem *main_item = row[0]; | |||
main_item->setData(description, QueryItemRole_Description); | |||
main_item->setIcon(QIcon::fromTheme("folder")); | |||
|
|||
const QIcon create_query_folder_icon = g_icon_manager->get_object_icon("folder-query"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not related to the commit topic. Better move to another commit or create refactor branch
@@ -68,7 +67,9 @@ void QueryItemImpl::fetch(const QModelIndex &index) { | |||
// NOTE: reset icon and tooltip in case query is in the | |||
// "out of date" state | |||
QStandardItem *item = console->get_item(index); | |||
item->setIcon(QIcon::fromTheme(query_item_icon)); | |||
|
|||
const QIcon create_query_item = g_icon_manager->get_object_icon("query-item"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not related to the commit topic. Better move to another commit or create refactor branch
@@ -11,28 +12,54 @@ IconManager::IconManager() | |||
{ | |||
} | |||
|
|||
void IconManager::init() | |||
void IconManager::init(QString icon_theme) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Init method is used for object initialization. In my opinion its better to create another function like set_theme() to change themes.
src/admc/settings.h
Outdated
@@ -99,6 +99,7 @@ DEFINE_SETTING(SETTING_create_shared_folder_dialog_geometry); | |||
DEFINE_SETTING(SETTING_create_contact_dialog_geometry); | |||
DEFINE_SETTING(SETTING_find_policy_dialog_geometry); | |||
DEFINE_SETTING(SETTING_time_span_attribute_dialog_geometry); | |||
DEFINE_SETTING(SETTING_icons_theme_geometry); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think better rename it to "SETTING_icons_theme" and move it to "Other" settings. This does not apply to geometry settings.
src/admc/main_window.cpp
Outdated
|
||
g_icon_manager->init(name_theme); | ||
|
||
const QIcon create_user_icon = g_icon_manager->get_object_icon(OBJECT_CATEGORY_PERSON); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my opinion better remove "create" word from icon object's name. Verbs are commonly used in function names
src/admc/main_window.cpp
Outdated
g_icon_manager->init(name_theme); | ||
|
||
const QIcon create_user_icon = g_icon_manager->get_object_icon(OBJECT_CATEGORY_PERSON); | ||
ui->action_create_user->setIcon(create_user_icon); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To set action icons pass action pointers to icon manager someway. You can pass it when you initialize icon manager as an option
src/admc/settings.cpp
Outdated
@@ -112,3 +112,17 @@ void settings_set_variant(const QString setting, const QVariant &value) { | |||
|
|||
settings.setValue(setting, value); | |||
} | |||
|
|||
QList<QString> settings_get_themes (){ | |||
QSettings::setPath(QSettings::NativeFormat, QSettings::SystemScope, "/etc/icon-theme-ActiveDirectory"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure this is a good idea to move configs to the system scope?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А что такое /etc/icon-theme-ActiveDirectory ?
Это файл настройки или каталог? Если каталог, то для чего?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Это каталог в котором лежит файл конфигураций с темами иконок.
Этот каталог и файл конфигураций в нем создаются при установке пакета с темами значков:
https://github.com/LenkaDEA/admc_icons/tree/themes
src/admc/settings.cpp
Outdated
|
||
QStringList all_themes = set.allKeys(); | ||
for( QString &name_theme : all_themes ) | ||
name_theme_list.push_back(set.value(name_theme).toString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think better check themes availability. It was done somehow here #369
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Здесь я читаю все темы из конфига. Если темы не установлены, то они и не будут доступны для выбора пользователя.
Что именно сделать как там?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Если я верно поняла твою мысль, то ты хочешь, чтоб просматривался весь каталог с темами, тем самым в списке выбора тем появились доп темы, что есть у пользователя. Верно я тебя поняла?
Если да, то считаю, что это лишний функционал.
- Нам не известно, как доп темы (которые установлены у пользователя на системе) будут дружить с нашим приложением.
- Если пользователь захочет поменять тему, то он поменяет ее скорее на всей системе.
- Наши темы более полные для нашего приложения, так что использовать, с большей вероятность, будут их, потому что это удобнее.
Если я не права, то поясните, потому это будет не лишним, пожалуйста.
@@ -28,6 +28,7 @@ BuildRequires: libkrb5-devel | |||
|
|||
Requires: libsasl2 | |||
Requires: libsasl2-plugin-gssapi | |||
Requires: icon-theme-ActiveDirectory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest dividing theme changing feature and new themes package addition (main icon too) into two pull requests, but I am not sure about it.
066da7d
to
338f326
Compare
Added icon themes: Active-Directory-line, Active-Directory-duotone, Active-Directory-color
Icon themes are set separately: https://github.com/LenkaDEA/admc_icons/tree/themes