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
feat: add rules #513
feat: add rules #513
Conversation
0d2934f
to
37855cf
Compare
ef8c2df
to
7c83726
Compare
7c83726
to
ed9f70e
Compare
@sylveon I am sorry to ping you but does this PR need anything to move forwards? |
No, there isn't anything needed on your part. I've been busy with school starting up again, but will try to look at it this weekend. |
No problem. Take care of yourself and your study. I just have some free time and wanted to work on this if there is any thing holding it back. |
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.
Looks pretty decent overall. I would suggest getting rid of Rule
and instead storing something similar to WindowFilter
:
std::unordered_map<std::wstring, TaskbarAppearance> m_ClassRules;
std::unordered_map<std::wstring, TaskbarAppearance> m_TitleRules;
win32::FilenameMap<TaskbarAppearance> m_FileRules;
because it will allow more efficient lookup, and also prevents the user having rules based on process name that differ only by case (and allows the case insensitive lookup to be a simple m_FileRules.find(windowFileName)
)
Also, you have to handle the case where settings are changed from the context menu - right now it wipes the rules when that happens. It can just be a temporary workaround for now, as I plan to add a GUI to add exclusions, so I'll be able to properly cover rules with that as well.
sorry, how would the json representation of this look like? I am having a hard time visualizing this.
can't really find this, where is the logic of the save? |
The representation in JSON can stay the same, what I was thinking is changing the internal representation.
It's here, but apparently it does already work fine, so there is nothing to actually change, my bad. TranslucentTB/TranslucentTB/mainappwindow.cpp Line 115 in fabcc77
|
Not sure if that is possible, with "maximisez_window_appearance": {
...
"rules": {
"window_class": {
"some_window_class": {
"color": "#1f1f1f",
...
},
"other_window_class": {
"color": "#1c1c1c",
...
}
}
"window_title": {
"some_title": {
"color": "#00000",
...
}
}
}
} |
I pushed a commit with the TranslucentTB/TranslucentTB/taskbar/taskbarattributeworker.cpp Lines 1034 to 1037 in dcfa989
I didn't touch this part and I don't know why it is failing. Edit: here is the output
|
Thanks for the contribution! |
The goal of this PR is to customize TTB behavior with rules, for example: