How can I change the color of a comment box or background in the inspector when it's in the active state?

I’m trying to determine if there is a way to change the box border color of a comment in the inspector when it is in the active state, and if so, what the path is. Alternatively, is there a way to change the background color of the comment in the inspector when it’s in the active state?

When clicking on a comment linked to selected text, and thereby changing it to the active state, the Comments & Footnotes panel of the Inspector slightly changes the color of the surrounding box (see the arrows):

My challenge is that the change when in the active state is so slight that it’s hard to locate it against a great many adjacent comments.

Before I delve deeper into modifying my custom theme using the Qt stylesheet, I want to confirm that the dynamic state of a comment being highlighted (due to selecting the corresponding anchor in the editor) is not mapped to a unique QSS selector. I worry that it’s handled internally by Scrivener’s code, rather than by a QSS-exposed class. If I am correct, then it might be futile to try to develop some CSS code for the QSS file that would allow me to change the color of the box’s border when the comment is in the highlighted state.

Edit: For my own reference, the code I’ve already added to the Qt stylesheet is here: Dark Mode: Scroll bar so dark I can barely see it - #10 by SCN

If anyone knows it would be Antoni Dol. Message him directly. I get around it by using different colors, too hard to see otherwise or locate especially if similar color comments are in close proximity in the text.

1 Like

Yes, Scrivener adds an overlay to the basic color that AFAIK cannot be controlled by the QSS.

I’m sure it is meant to have a purpose, but this is something Themebuilders would rather have not implemented this way, or at all for that matter.

2 Likes

Thanks for confirming my thinking on this.

Sure, it would be great to be able to control the box lines around comments. There’s room for improvement here, to be sure.

That said, Scrivener’s customization features are wonderfully robust, provided we are willing to dive into the Qt style sheet. Not everyone has the time or ability to do that, though. Perhaps in a future update, more of this customization potential can be surfaced for less-technical users.

I once tried to build a Palette Editor. Maybe now with AI programming, it could be possible…

2 Likes

How interesting! So, it would be a separate app that would write to the Scrivener Qt style sheet, then?

Are you thinking of building it in Qt so that it’s cross-platform? Hmm. The Windows version implements customization differently than the other versions, so it would have to be smart enough to work with both approaches, right?

No, the. Pal-file is just plan text, but the UI should make it easy to choose colors, and create coherent color palette. I tried using Qt6, but that didn’t work…

Ah, yes–the .pal file, where the theme’s RGB elements are set. I’d forgotten about that.

Such an app could, additionally, write CSS to the QSS file, for even more customization.

I suppose it could write to the .prefs and .xml files, too.

It could then package the four theme files into a .scrtheme (zipped) file and save it to the directory at C:\Users\<YourUsername>\AppData\Local\LiteratureAndLatte\Scrivener\Themes folder (in the case of Windows).

The user would then select the new theme inside Scrivener.

I haven’t written code in many years, but I’m sure that with AI help, it’s something that could be done even with minimal coding skills.

I’ve never tried writing with Qt, and I’ve never coded in C++. What was the stumbling block for you?

I got code that was not working, and knew too little about the Programming Environment. Needed the hard drive space and uninstalled the QT platform.

Understood. I’m sure you would have eventually succeeded, but we have to choose where to spend our time, and it seems you’ve avoided a significant drain on your time. I don’t blame you. (I have to keep reminding myself to focus on my writing.)

pal文件里修改一下
Highlight(55,89,148) //A background color to indicate a selected item or the current item

评论边框将呈现蓝色(或者修改你想要的颜色)

Highlight(55,89,148) //A background color to indicate a selected item or the current item 

大概因为网络的缘故,图片上传不成功,这里修改的背景颜色会改变菜单栏选项背景颜色,页脚统计字数,选中后提示选中字数的字体颜色,以及注释里评论边框的颜色(会有延时或者需要重复点击一下试试)

So, add this to the .pal file? I’ll try it Thanks!

另外,还想求问一下,大纲视图那里的标题怎么调整颜色?我参考了论坛上的qss几乎把能改的都改了,只剩大纲模式下的标题无法修改颜色,您的问题正好我最近发现选定文字后页脚那里的文字颜色成了灰色,太看不清了,所以折腾了好久才发现是背景的缘故,正巧我看到我的评论区框架显示的颜色更刚刚更改的背景颜色一样,所以才碰巧对应上了,只是我很无奈,我实在动不了标题的颜色

大纲模式和软木板那里都是无解的存在,动不了深色模式下,白色字体的设定