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
Custom Theme v2 #70
base: master
Are you sure you want to change the base?
Custom Theme v2 #70
Conversation
For list-view #kupfer-list-view {
background-color: @theme_bg_color;
color: white;
}
#kupfer-list-view:selected {
background-color: @theme_selected_bg_color;
color: @theme_selected_fg_color;
} |
Will this method work in other desktop environments ? Like xfce ? |
Of course. |
Thanks for the PR! Variables like What I am not sure of here is if the given light/dark theme definitions are enough. I suspect they are not, and the result will be a mix of the user's selected theme and the light/dark css file. I don't claim this is easy to fix, I would like to find someone who has solved this before. |
I agree with you on the point that , the given definitions of light/dark themes may not be sufficient and may require some other definitions. What I have ensured in my PR is that, there is scope for any changes to be done easily. That is the reason why I am using different CSS files for different themes. I think we can still resolve this issue by providing supplementary definitions. |
Right. It could simply be
Yes. They are not enough as it is for every other gtk-3 apps. That's why I propose to use However if you do decide to set hard-coded value for fg/bg/base color, It will be up to you. |
If we want to just stick to the theme colors, then we can also just set the prefer dark variant or not boolean. This seems neat as a way to switch between different CSS's though. I would like to structure it like this: One default style.css file that is always applied. It applies some important style things that makes the preedit field use no space when it's hidden and so. Then, a selector that loads one out of several css files. We can pick these from a specific directory, that makes them user installable(?). It looks like we can use Gtk.StyleContext.remove_provider_for_screen to remove css tweaks again, so that we don't need to restart. |
Also here we can consider if the custom css part maybe is best as a plugin |
The plugin provided by @bluss does the work well. I am impressed by the simplicity of the plugin provided. Closing this PR. |
I thought that picking custom css would be a separate and additional thing. |
Of course. Should I give another PR by integrating the plugin and custom css concepts ? |
Let's be clear what the real goal is. I'm fine if this goal comes from your ideas. We've got some things that are already solved:
For me, I want Kupfer to be user themable. I can formulate my goals as project maintainer:
It sounds like from you and me that we need some way to rearrange the widgets in Kupfer, everything that's not reachable from css.
And maybe you want that it's easy to install and select custom kupfer css
Now is it a goal that Selecting CSS should also change the Widget Layout? That seems logical. So those two want to be combined somehow. But selecting CSS is easy, we basically know how to do that now I think. So it remains to work on the Select Widget Layout part. |
I don't want to expose the exact widget layout (Like a .ui xml file), because then we can't change kupfer at all without breaking themes. |
Can we do something like this in browser.py -> class Interface() -> L1144 def get_widget(self):
#Selects which get_widget function to execute based on User Setting.
#The user selects this option through a plugin.
layout = #extract from settings
if layout=='default':
vbox = self.get_widget1()
elif layout=='minimal':
vbox = self.get_widget2()
return vbox By hard coding layouts, we need not expose the complete UI in XML file.
The user would have an option to select his preferred layout and CSS separately through a plugin, so that we can extend the same CSS file to multiple layouts. |
This sounds good to me. CSS should be able to adjust margins and paddings around everything, so ideally only the layout (H vs V boxes and so on needs to be changed). I think we have layout options like:
|
I have reopened this PR. I will provide some more commits in the coming days. Will it be okay if a layout type hides a pane ? eg. I tried to list some shortcomings of hiding a pane:
We again need to handle the keypress on changing the layout which is tedious. Can there be any other solution to this problem (to prevent the tab key from shifting focus)? |
Hiding a pane, why? |
It should be possible to adapt keystroke handling to not showing the action pane, but I'm not very fond of the idea of hiding it in general. Maybe a layout / theme can make it smaller instead? I had the idea #77 in the back of my mind, which involves temporarily hiding the action pane. |
Here's a QS theme that deemphasizes the action pane without hiding it (“Cube”) http://tonyarnold.com/2006/07/07/quicksilvers-new-cube-ui.html |
…ge_theme from main.py" This reverts commit b08b1a1.
Hi, is this ready for feedback? |
Hi! No, this is not the final version for feedback. But the current version is fairly ready for suggestions. I am currently very busy. Hence , it is causing delay. |
Ok, no problem, there is no rush from my side. |
|
The user defined themes are assumed to be present in ~/.local/share/kupfer/ directory. The *.css files are scanned and loaded as choices.
Hi @bluss ! I have completed the custom_theme plugin. Please review it and provide your suggestions. These files need to be copied into ~/.local/share/kupfer directory. Please provide your valuable feedback. |
Only the file custom_theme.py is kept intact . All changes in previous commits are reverted.
Does this solve round corner issue? |
No, this does not solve the round corner issue. This PR is meant only to enable the user to select and apply any custom theme. Please review @khurshid-alam . |
[ UPDATE ]
Example themes (CSS files) are given here