Comments (12)
A 5th option would be to do it programmatically from a python script (for example, by allowing to override the _init_styles() function)
from kconfiglib.
6th option might be to make the default less ugly. I did my best with it, but I'm not exactly Rembrandt. That yellow color in particular probably isn't the prettiest thing in the world...
If someone comes up with a nicer color scheme (or other UI improvement), I'm happy to take it in. Not sticking to just the predefined colors might help too.
The C menuconfig gets decent looks from using lxdialog, but I don't like how it wastes terminal space, and resizing is super janky (including a segfault if you accidentally make the window too small).
from kconfiglib.
I don't think it's ugly, actually it's pretty decent even for Rembrandt standards.
The problem is that when I present this to other people they expect the ctools "kconfig" theme. So I was hoping to customize it with colors that are more in-line with the project so instead of a "uh, huh... why is it yellow?" questions I would get more "Oh, cool" reactions :)
It's not super important, so if you think it's pointless to have, please close the issue.
from kconfiglib.
I tried to go for the make menuconfig
colors at first, but iirc I ran into color clashes due to the more compact layout.
Could you try tweaking the colors manually in _init_styles()
and seeing if you can come up with something more make menuconfig
-like that looks nice? Once we know that it's possible, I could try to come up with some theming thing.
from kconfiglib.
Search for "predefined" in https://docs.python.org/3/library/curses.html to see the list of predefined colors.
Might be able to use curses.init_color()
to get custom colors, though it's terminal-dependent (should check curses.can_change_color()
in that case too).
from kconfiglib.
I will give it a shot.
I thought init_color() was only for RGB-type colors (some terminals do support that). I might try with the standard 16 colors at first, see how far I get.
from kconfiglib.
Ok, this is what I came up with. Frankly, it looks more like Norton Commander than lxdialog :)
As you said, it's really hard to match the lxdialog scheme because of the borders and all that.
Anyway, here's the patch:
diff --git a/menuconfig.py b/menuconfig.py
index 2166787..266578e 100755
--- a/menuconfig.py
+++ b/menuconfig.py
@@ -184,7 +184,7 @@ def _init_styles():
# Separator lines between windows. Also used for the top line in the symbol
# information dialog.
- _SEPARATOR_STYLE = _style(curses.COLOR_BLACK, curses.COLOR_YELLOW, BOLD, curses.A_STANDOUT)
+ _SEPARATOR_STYLE = _style(curses.COLOR_WHITE, curses.COLOR_CYAN, BOLD, curses.A_STANDOUT)
# Edit boxes
_INPUT_FIELD_STYLE = _style(curses.COLOR_WHITE, curses.COLOR_BLUE, curses.A_NORMAL, curses.A_STANDOUT)
@@ -192,25 +192,25 @@ def _init_styles():
# List of items, e.g. the main display
_LIST_STYLE = _style(curses.COLOR_BLACK, curses.COLOR_WHITE, curses.A_NORMAL )
# Style for the selected item
- _LIST_SEL_STYLE = _style(curses.COLOR_WHITE, curses.COLOR_BLUE, curses.A_NORMAL, curses.A_STANDOUT)
+ _LIST_SEL_STYLE = _style(curses.COLOR_WHITE, curses.COLOR_BLUE, BOLD , curses.A_STANDOUT)
# Like _LIST_(SEL_)STYLE, for invisible items. Used in show-all mode.
_LIST_INVISIBLE_STYLE = _style(curses.COLOR_RED, curses.COLOR_WHITE, curses.A_NORMAL, BOLD )
_LIST_INVISIBLE_SEL_STYLE = _style(curses.COLOR_RED, curses.COLOR_BLUE, curses.A_NORMAL, curses.A_STANDOUT)
# Help text windows at the bottom of various fullscreen dialogs
- _HELP_STYLE = _style(curses.COLOR_BLACK, curses.COLOR_WHITE, BOLD )
+ _HELP_STYLE = _style(curses.COLOR_CYAN, curses.COLOR_BLUE, BOLD )
# Top row in the main display, with the menu path
- _PATH_STYLE = _style(curses.COLOR_BLACK, curses.COLOR_WHITE, BOLD )
+ _PATH_STYLE = _style(curses.COLOR_CYAN, curses.COLOR_BLUE, BOLD )
# Symbol information text
_INFO_TEXT_STYLE = _LIST_STYLE
# Frame around dialog boxes
- _DIALOG_FRAME_STYLE = _style(curses.COLOR_BLACK, curses.COLOR_YELLOW, BOLD, curses.A_STANDOUT)
+ _DIALOG_FRAME_STYLE = _style(curses.COLOR_WHITE, curses.COLOR_CYAN, BOLD, curses.A_STANDOUT)
# Body of dialog boxes
- _DIALOG_BODY_STYLE = _style(curses.COLOR_WHITE, curses.COLOR_BLACK, curses.A_NORMAL )
+ _DIALOG_BODY_STYLE = _style(curses.COLOR_CYAN, curses.COLOR_BLUE, BOLD )
#
from kconfiglib.
Doesn't look all too shabby. Bit more relaxed to compared to the other theme.
Maybe I could add it as an alternate theme, enabled in the environment via MENUCONFIG_THEME=aquatic
or the like. I'm a bit scared of adding a fine-grained styling mechanism, in case I later decide to make significant changes to the interface (no such plans at the moment, but you never know).
I like that you bolded the selected item. Might steal that for the other theme as well.
Here's how it comes out on gnome-terminal:
from kconfiglib.
Actually looks OK even on gnome terminal.
Regarding fine-grained styling -- I believe it's up to the user to maintain the compatibility with newer versions. If they choose to upgrade kconfiglib, they should be aware that their custom theme may require tweaking. In any case, reverting to the default theme should be straightforward. But again, this is a nice to have feature, but far from being essential.
Truthfully, the only issue with the yellow theme is that people usually associate kconfig with the lxdialog color scheme and think that I purposedly changed it to yellow for some reason :)
from kconfiglib.
Added the new theme: 84bd863
I tweaked the colors for dialog boxes and the jump-to dialog to make them a bit more readable. Check if looks alright.
Got lazy and went for a hardcoded version for now. Might add some external styling mechanism later, if more styles show up.
from kconfiglib.
Looks great, thank you!
You can close this issue.
from kconfiglib.
Alright, closing. Thanks!
Pushed out a new release with the theme too.
from kconfiglib.
Related Issues (20)
- kconfiglib handles string literals inconsistently across operating systems
- option modules on non MODULES HOT 1
- Backspace bug in Msys2 version
- Prompt shown even when expected to be disable.
- Struggling with comprehending the documentation HOT 1
- Parsing error in kconfiglib when upgrading to yocto 3.3 (hardknott)
- kconfiglib needs a new maintainer? HOT 16
- error: couldn't parse 'modules': unrecognized construct HOT 1
- Boolean default not taken if written after help
- fails if the parent directory contains spaces HOT 1
- Inaccessible to screen readers
- `make menuconfig` fails when the parent directory contains spaces.
- New release request
- Extension Suggestion: Strings without quotation marks (Macro-like)
- Error parsing Kconfig sources:- couldn't parse 'modules': unrecognized construct
- I made a standalone menuconfig HOT 1
- The default `conf` mode seems missing HOT 1
- doc: Documentation issue in 'Readme.rst' - broken hyperlink from kconfiglib to zephyrproject
- When searching symbol with guiconfig, there is an exception
- Support a getconfig module HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kconfiglib.