-
-
Notifications
You must be signed in to change notification settings - Fork 178
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
Improve Preferences and Theme handling #1077
Comments
The resetting to empty value if its not in the theme that we do for some of the entities shouldnt be there I think. The the question is whether we lay the user prefs over the theme or the other way around. Maybe we could also have |
I think explicitly loading a theme should overwrite user settings. But should settings get lost then just because you wanted to try a theme? What if loading a theme only sets/overwrites the users prefs (if set before) and defaults the ones not defined in the theme? So on startup:
on theme load:
can you follow me? |
I thought about adding a |
As seperate |
Part of the issue here is that profrc is not actual rc-file, that is ordered sequence of run-commands; instead it is unordered configuration file and thus has no way to express precedence. For storing the user configuration you will possibly want Vim-like tracking of which file modified which configuration option last. Then you can save only those user actually set. |
When we rework this we should also take care of #721 |
I prefer the second as I don't want to have to redo my settings again only because I tried a theme (see #1218). I would consider settings in a theme a recommendation that will be used if you didn't set the setting yourself, but if you set it yourself than probably because you are particular about it and want it this way. Or you could split themes in themename.theme and themename.settings and |
So far `/occupants char *`, `/roster contact char *`, `/roster room char #`, `/roster header char -`, `/occupants header char -` was saved and loaded from the preferences. But was overwritten when the theme was loaded. If the theme didn't set these values the value was just cleared. Despite that it might have been set in the users preferences. Funny enough the themes don't operate generally like this. For example `otr.char` is not cleared. This is again due to our borked theme/prefs concept (#1077). For now let's just use the one set from the preferences if it's set. The theme will however overwrite it if it is set there. Fix #1244
Yes dividing it so we have a So in this case we cover:
Just writing my thoughts here. |
3) Why not loading the theme with the desired settings, set the few settings you want to change and '/save'?
Am January 29, 2020 9:50:03 AM UTC schrieb Michael Vetter <notifications@github.com>:
…Yes dividing it so we have a `/theme load name` for the colors and `/theme load-settings` to load the preferences would also be easiest to implement I think. We even can let the theme files stay as they are and in one case only load the `colours` section from it.
So in this case we cover:
1. User starts from the beginning, has no preferences or ideas about them, and wants to see what is possible. So he loads various themes. Gets different colors and different settings. Once he finds one he sticks with it. Maybe also because he likes the settings. At some points he decides he is sick of the colors and wants different ones. Then he can choose to just load the colours part of another theme.
2. User has his settings, put together over weeks. But he wants different colors now and then.
3. User wants most of the settings from a certain theme. But has some minor wants that he is sure to always need. Like a special char for OMEMO for example. So he needs to create his own theme. Load the new theme completely and then load his theme which just contains the settings about OMEMO char and no color settings.But this means: should when do reset the settings at some point? I guess we should once we load a theme. Otherwise we might get left overs from previous loaded themes that are not set in the current one.
Just writing my thoughts here.
So what I'm not sure about is:
Should we reset the settings upon each theme load?
Should we just load the new things and leave everything else as is? Would be easiest.
|
I think if a setting is explicitely set in profrc it should be never overwritten as you put it there for a reason.
Am January 29, 2020 9:50:03 AM UTC schrieb Michael Vetter <notifications@github.com>:
…Yes dividing it so we have a `/theme load name` for the colors and `/theme load-settings` to load the preferences would also be easiest to implement I think. We even can let the theme files stay as they are and in one case only load the `colours` section from it.
So in this case we cover:
1. User starts from the beginning, has no preferences or ideas about them, and wants to see what is possible. So he loads various themes. Gets different colors and different settings. Once he finds one he sticks with it. Maybe also because he likes the settings. At some points he decides he is sick of the colors and wants different ones. Then he can choose to just load the colours part of another theme.
2. User has his settings, put together over weeks. But he wants different colors now and then.
3. User wants most of the settings from a certain theme. But has some minor wants that he is sure to always need. Like a special char for OMEMO for example. So he needs to create his own theme. Load the new theme completely and then load his theme which just contains the settings about OMEMO char and no color settings.But this means: should when do reset the settings at some point? I guess we should once we load a theme. Otherwise we might get left overs from previous loaded themes that are not set in the current one.
Just writing my thoughts here.
So what I'm not sure about is:
Should we reset the settings upon each theme load?
Should we just load the new things and leave everything else as is? Would be easiest.
|
There is only one place where for example |
So we could not set [ui] settings only [colours] settings when loading from a theme. Like we discusses with 'load' and 'load settings'. But after it is set there is no destinction anymore where it came from. |
So far when loading a theme it also overwrote the preferences the user set. Lengthy discussion can be found at #1077 Now we use `/theme load themename` to load the [colours] part of a themem only. `/theme full-load themename` will load the complete theme including preferences set in there. Regards #1077
@mdosch I just pushed a commit to master that has now Could you test if it works as expected? |
I can confirm it's working as expected: |
Then I think now we have all the functionality we want/need. |
We have a bit borked handling for this.
In profanity.c we first load the prefs. From there we get which theme to use, so later on we load the theme.
Later in
src/config/theme.c
in_load_preferences()
we load the preferences set in the theme.In some cases, like
statusbar.tabs
, we just overwrite the value we get from the theme.In others, like
roster.header.char
,occupants.header.char
, we either set it from the theme or reset it (prefs_clear_roster_header_char()
).Since a theme can contain UI settings like color, but also things like the characters we have no clear separation between user settings and themes.
So if we want a theme to be consistent we will need to always prefer the theme settings, and users are forced to create their own themes if they want to have certain settings differently.
Currently this happens:
statusbar.tabs
to 5. Then switches to theme Y which has no setting for this, then he will still have the leftover from theme X.So I think we need to do the following once a theme is set (at start of profanity or when changing):
Or:
Sorry I think this issue is not well structured :-) I hope its understandable though.
The text was updated successfully, but these errors were encountered: