Skip to content
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

ide: introducing themes management #1150

Merged
merged 12 commits into from
Dec 19, 2014

Conversation

vdonnefort
Copy link
Contributor

This patch adds IDE themes management. It has the same behaviour as QtCreator.
There is some default theme provided and the user can copy them to create a new
one. Only user created theme can be edited. For now only default theme is
provided: "default".

This patch adds IDE themes management. It has the same behaviour as QtCreator.
There is some default theme provided and the user can copy them to create a new
one. Only user created theme can be edited. For now only default theme is
provided: "default".
Only background color is used for current line, this patch disables so others
options for this entry to improve understanding for users.
There is no difference between General and Syntax categories. This patch
consequently removes them.
The bug was introduced by the following patch:
  ide: themes: remove General and Syntax categories
This patch adds the ability to the theme management to look for a previous
custom theme and if available import it into a new theme called "My old theme".
@vdonnefort
Copy link
Contributor Author

I finished to fix my pull request according to Tim comments

@timblechmann
Copy link
Contributor

in general, it looks good to me. though testing it i came across one issue: post window text and post window emphasis of "my old theme" are imported with black foreground and background.

@vdonnefort
Copy link
Contributor Author

It seems I can't save the Qt::transparent color. The next time, the color will be loaded, it will be set black.

This patch modifies the legacy import strategy. Instead of overwrite the default
value with the found format, it merge them.
Some keys weren't imported due to a bad group name. This also patch makes sure
to erase all legacy theme artefacts from the settings file by removing both
highlighting and colors groups.
When introducing the theme management, the current line and post window text
formats were modified. This patch restores them to their previous value.
The Qt::transparent color can't be saved into the settings file. When loading
this color at the next startup, it is black. This patch avoid to set color
background when it is Qt::transparent.
@vdonnefort
Copy link
Contributor Author

Here's the fix for the "black background", coming with some other fixes.

@vdonnefort
Copy link
Contributor Author

Tim,

Did my last patches fixed your problem?

Is the branch ok for merge? Do you want me to create a new one with some squashed patchs?

@bagong
Copy link
Contributor

bagong commented Sep 27, 2014

Thanks for this, welcome addition, unobtrusive and useful. I'll start using it and let you know if I find problems.

The transparency-problem is not fixed though: As you said "transparent" doesn't get saved, this is still the case. It is applied at first, but after you restart sc, anything set transparent appears black.
The cosmetical bit: For me on first startup the post-windows-background appeared grey (the default used to be white (or transparent on top of white ground?)).

@bagong
Copy link
Contributor

bagong commented Sep 27, 2014

Maybe there is an interference with the "inactive editor fade" feature (which ignores the post window)?

@bagong
Copy link
Contributor

bagong commented Sep 27, 2014

It seems that in order to store transparency the the color for the feature must not be defined in sc_ide_conf.yaml. Currently background="000000" is written to the config file.

@vdonnefort
Copy link
Contributor Author

bagong,

It's indeed not possible to save the Qt::transparent value into the yaml file. That's the purpose of this commit: vdonnefort@09a805f. We don't set the format if the color is Qt::transparent.

I don't see any problem about it. Let me know the exact steps to reproduce it.

About the postwindow grey value, I'm a bit confused: I used the same color as before palette.brush(QPalette::Mid). Maybe I'd better to use Qt::transparent here.

@vdonnefort
Copy link
Contributor Author

Hum, I've just found how to reproduce the "transparency->black" problem:

Modify a foreground of a format which have a transparent background and then restart SC.

@bagong
Copy link
Contributor

bagong commented Sep 27, 2014

Easier: set any color value to transparent and it will be black on restart.

To match the pre-theme-management appearance, this patch sets the Post Window
Text background default value to transparent.
Since the transparent color can't be stored, this patch makes sure that when the
picked brush is Qt::NoBrush (~ color transparent), the background is not set.

It completes the following commit:
  ide: theme: fix transparent color
@vdonnefort
Copy link
Contributor Author

Bagong,

I just added two patches which must fix problems you reported. Let me know if this seems ok on your side.

@bagong
Copy link
Contributor

bagong commented Oct 1, 2014

Transparency and postwindow behaviour seem okay now. Occasionally it is not possible to open the color-picker - I haven't found a pattern to that yet. And for "current line" it is not possible to change text-color. "Italic" and "bold" also seem to be disfunctional (also if changed manually in sclang_config). Dunno if these later things relate to your PR.

@vdonnefort
Copy link
Contributor Author

Thanks bagong for your report. This PR is a quite huge project and it's very helpful to have people to test it!

  • I haven't any problem with the color-picker let me know if you find a pattern
  • the current line options are unavailable following the timblechmann review. See this commit: vdonnefort@2e604d7
  • I also have troubles with italic and bold. I will look at it.

@vdonnefort
Copy link
Contributor Author

Bagong,

I tested italic and bold for each text format. All non working italic and bold options are non related to my PR. They also belong to "General" syntax, my guess is it is no accident. @timblechmann could you confirm that? Do we want italic and bold options to be also disabled for these text formats?

@vdonnefort
Copy link
Contributor Author

Any other comments about this PR? :)

@timblechmann
Copy link
Contributor

sry for being silent, have been touring for the last weeks ... might take a bit that i can have a look at the PR ... but i will

@timblechmann
Copy link
Contributor

had a look and in general it looks good. it also converted my old theme correctly, though i'd suggest that some people will run this PR to see if their themes will be converted correctly.

one small issue: the "line numbers" option shows the wrong background when being "transparent": it uses the background color of the normal text(?), while it should show the background of the "line indicator", which afaict is QPalette::Mid

@vdonnefort
Copy link
Contributor Author

Thank you for your review.

What is "line indicator" when I set line number to "transparent" background I still see a gray color whereas my normal text background is white.

@vdonnefort
Copy link
Contributor Author

Any news about this PR?

@vdonnefort
Copy link
Contributor Author

@telephon @jleben @muellmusik Any news about this PR?

@telephon
Copy link
Member

I can't judge it and I can't tell from the discussion if the issues have been resolved?

@vdonnefort
Copy link
Contributor Author

@telephon, the only remaining opened point is the @timblechmann remark about "line numbers".

I may be wrong but the problem is not related to my PR and the whole line numbering thing needs some refactoring. It should have its own PR. I started discussing it with @timblechmann, I hope we will find a good solution.

This PM must so be merged without problems.

@muellmusik
Copy link
Contributor

Okay, in that case I'll merge.

muellmusik added a commit that referenced this pull request Dec 19, 2014
@muellmusik muellmusik merged commit 3e7c597 into supercollider:master Dec 19, 2014
@vdonnefort vdonnefort deleted the ide-theme-management branch December 19, 2014 13:16
@miczac
Copy link
Contributor

miczac commented Jan 21, 2015

Hi Vincent, I'm on OS X 10.8.5:
What 'current' theme would be converted: from 3.6 or 3.7a prior to this PR?
IAC as of 266456b (per now) the post window is black on black,
and the editor's theme colours are not converted entirely:
This is from 3.7a before this PR got merged:
screen_shot_2015-01-21_at_16 23 22
(note the dark-grey background of the current line)
which became this (per today):
screen_shot_2015-01-21_at_16 25 43
Is there anything I could/should test etc? thx, Michael.

@vdonnefort
Copy link
Contributor Author

Hi Michael,

At the first theme manager usage, the previous configuration is stored into "My old theme". The all elements remains the same.

I think you point the wrong commit id (266456b) :)

What I understand of your problem is: the "current line" is not correctly imported from the old theme. Is that correct?

If you set again the "current line" to black, is it working?

@miczac
Copy link
Contributor

miczac commented Jan 21, 2015

Sorry about the commit confusion! I meant to point at what version I compiled to test.
I didn't follow the recent developments and bisected to see what caused the miss-colouring.
Since I got many flavours of errors regarding the theme I decided to test the most recent version.
Yes, the import for the current line background is not correct: it's white, not dark grey as I set it.
And also yes, I can correct the colour in "My old theme" to dark grey, which is apparently
properly stored and recalled.
BTW, while testing I just found that I can't set the foreground colour of the current line.
[edit][2] I can see the colour box but clicking on it has no effect.
But I can set the other foreground colours.

@vdonnefort
Copy link
Contributor Author

  • I can't even see any currentLine configuration applied w/ Ubuntu (w/ or /w theme management support). I'll give a try later w/ a OSX 10.9
  • The second point you're talking about is related to this commit:
    2e604d7 ide: themes: disable unused options display for currentLine
    This is a "normal" behaviour. The colour box is disabled.

@vdonnefort
Copy link
Contributor Author

@miczac How do you trig the "current line" colors? :)

@miczac
Copy link
Contributor

miczac commented Jan 25, 2015

Not sure what you mean by "triggering", It's just there:
sc37a-current_line-2
also when there's a fresh profile:
sc37a-current_line-no_prev_profile
regarding "disable unused options display for currentLine" - is the interface meant to reflect this disabled state? IOW, how would a user realise that the fg-colour can't be set? What would be the indication?

@vdonnefort
Copy link
Contributor Author

  • I mean that even if I set a red background for "Current Line", I never see any red on my editor with any SC version.
  • The disabled mode in Qt is sadly not visible, we'd better to remove the color picker!

@miczac
Copy link
Contributor

miczac commented Jan 25, 2015

  • AFAICS no problem here to set. Just had a terrible pink for a test. ;)
  • BTW, what's the idea of this checkbox [x] to the right of the picker? Clicking it the picker becomes inaccessible ("disabled"). But clicking it again doesn't show it's active again, only if I selected a colour via the picker (by clicking on the shaded version of the picker box). What's this checker good for?

@vdonnefort
Copy link
Contributor Author

The checkbox allows to "remove" the color, to set it to "transparent".

@vdonnefort
Copy link
Contributor Author

@miczac, this patch vdonnefort@ee832c9 should fix your import problem: some keys (created after 3.6) weren't imported.

@miczac
Copy link
Contributor

miczac commented Jan 26, 2015

@vdonnefort importing from a 3.7a profile created before this PR works now. CurrentLine is there - thx!
And I can see now what you probably meant by "I can't even see any currentLine configuration".
I deleted the entire profile, created one by starting 3.6.6, switched to 3.7a/post PR and also don't even see a selection for "Current Line". It looks a bit weird ATM, have too look again this evening, need to see the pattern.

@vdonnefort
Copy link
Contributor Author

Thanks @miczac for testing!

Do you have any other problems before I send a PR?

@miczac
Copy link
Contributor

miczac commented Jan 26, 2015

@vdonnefort - if you could wait until evening, something appears weird when switching versions of SC and "updating" then. I got rehearsals now - have to have a deeper look, maybe it's just me.

@miczac
Copy link
Contributor

miczac commented Jan 27, 2015

@vdonnefort - I can see a probably similar situation like you described before about your system:
I'm not able to make CurrentLine work if there's no profile at the first place. Curiously enough I also don't get it when using an older binary compiled before this original themes-PR. IAC I can see the selection entry for CurrentLine but choosing a colour has no effect. Also when I create a fresh profile by starting 3.6.6 after deleting the profile and step be step "update" the profile by starting newer binaries.
The background colour of CurrentLine only works to be set when using my existing profile.

@vdonnefort
Copy link
Contributor Author

Thanks again @miczac. This is not related to my patch but I will give a look at it.

I updated my branch https://github.com/vdonnefort/supercollider/commits/scide/theme-mgmt-fix with your remarks about the clear foreground button.

@vdonnefort
Copy link
Contributor Author

@miczac The current line needs the "highlight current line" option set to work (settings > editor > display). I think I can now send the new PR.

@miczac
Copy link
Contributor

miczac commented Jan 28, 2015

@vdonnefort - ah forgot to check. :/ That's it of course.
And from this experience, it would be convenient if disabled GUI-elements reflected their state. (my 2c)
Thanks for the reminder! ;)

@vdonnefort vdonnefort mentioned this pull request Jan 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants