thegooglecodearchive / marave

Automatically exported from code.google.com/p/marave
GNU General Public License v2.0
0 stars 0 forks source link

Zoom level changes when chaging color #51

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
To reproduce do the following:

1 - Remove any stored QSettings
2 - Start marave
3 - Type some letters
4 - Change zoom level
5 - Change font color

The zoom level will then reset to default.

I have a feeling the issue here is that marave always expects to find some
stored values in the QSettings or something and they are not properly
initialized when starting fresh, or something like that.

Original issue reported on code.google.com by filipe.c...@gmail.com on 15 Feb 2010 at 2:14

GoogleCodeExporter commented 9 years ago
I can't reproduce this. I am using r266, what version are you on?

Original comment by roberto.alsina on 15 Feb 2010 at 2:43

GoogleCodeExporter commented 9 years ago
I'm using r266 on macosx 10.5
This only happens when there are settings saved anywhere, from a fresh install.
I can see if I can track this some more.

Original comment by filipe.c...@gmail.com on 15 Feb 2010 at 2:53

GoogleCodeExporter commented 9 years ago
I tried deleting the settings first, still it doesn't happen for me. The only 
way this could 
happen is if there's a call to self.editor.larger() [or smaller] that didn't 
call 
self.settings.setValue('fontsize')

Original comment by roberto.alsina on 15 Feb 2010 at 3:03

GoogleCodeExporter commented 9 years ago
I think the problem is that fontcolor is not properly initialized.

Original comment by filipe.c...@gmail.com on 15 Feb 2010 at 3:32

GoogleCodeExporter commented 9 years ago
The following patch seems to work for me:

--- main.py     (revision 266)
+++ main.py     (working copy)
@@ -733,6 +733,8 @@
         fontcolor=self.settings.value('fontcolor')
         if fontcolor.isValid():
             self.setfontcolor(QtGui.QColor(fontcolor.toString()))
+       else:
+            self.setfontcolor(QtGui.QColor('black'))

     def loadOpacity(self):
         o,ok=self.settings.value('editoropacity').toInt()

Original comment by filipe.c...@gmail.com on 15 Feb 2010 at 3:35

GoogleCodeExporter commented 9 years ago
The bottom issue seems to be that if you have a widget without any stylesheet 
and
then you change the font size on that widget and then you set its stylesheet to
change some colors, the font size will be lost. If on the other hand you do the 
font
size change after creating any kind of stylesheet the change is kept even if 
you then
change the stylesheet. This might very well be a Qt bug with stylesheets. I'm 
always
a bit afraid of them.

Original comment by filipe.c...@gmail.com on 15 Feb 2010 at 3:38

GoogleCodeExporter commented 9 years ago
Why not, it makes sense. Committed in r267. Should I mark this fixed?

Original comment by roberto.alsina on 15 Feb 2010 at 3:40

GoogleCodeExporter commented 9 years ago
I think so. At least it works for me.

Original comment by filipe.c...@gmail.com on 15 Feb 2010 at 3:42

GoogleCodeExporter commented 9 years ago
Could be a bug with stylesheets on mac since it doesn't happen for me on Linux. 
Anyway, 
thanks for the help!

Original comment by roberto.alsina on 15 Feb 2010 at 3:45