mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Fixing default font on preference window
Default font was hardcoded as 14. What happen if you change any other preference value is that the application would start to use fontSize=14. This commit loads the right value in the QDoubleSpinBox Signed-off-by: Danilo Cesar Lemes de Paula <danilo.eu@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									30b25d1212
								
							
						
					
					
						commit
						5846ff972d
					
				
					 2 changed files with 4 additions and 1 deletions
				
			
		| 
						 | 
					@ -278,8 +278,11 @@ void PreferencesDialog::loadSettings()
 | 
				
			||||||
	QFont defaultFont = s.value("divelist_font", qApp->font()).value<QFont>();
 | 
						QFont defaultFont = s.value("divelist_font", qApp->font()).value<QFont>();
 | 
				
			||||||
	defaultFont.setPointSizeF(s.value("font_size", qApp->font().pointSizeF()).toFloat());
 | 
						defaultFont.setPointSizeF(s.value("font_size", qApp->font().pointSizeF()).toFloat());
 | 
				
			||||||
	qApp->setFont(defaultFont);
 | 
						qApp->setFont(defaultFont);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	GET_TXT("divelist_font", divelist_font);
 | 
						GET_TXT("divelist_font", divelist_font);
 | 
				
			||||||
	GET_INT("font_size", font_size);
 | 
						GET_INT("font_size", font_size);
 | 
				
			||||||
 | 
						if (prefs.font_size < 0)
 | 
				
			||||||
 | 
							prefs.font_size = defaultFont.pointSizeF();
 | 
				
			||||||
	GET_INT("displayinvalid", display_invalid_dives);
 | 
						GET_INT("displayinvalid", display_invalid_dives);
 | 
				
			||||||
	s.endGroup();
 | 
						s.endGroup();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -26,7 +26,7 @@ struct preferences default_prefs = {
 | 
				
			||||||
	.gflow = 30,
 | 
						.gflow = 30,
 | 
				
			||||||
	.gfhigh = 75,
 | 
						.gfhigh = 75,
 | 
				
			||||||
	.gf_low_at_maxdepth = false,
 | 
						.gf_low_at_maxdepth = false,
 | 
				
			||||||
	.font_size = 14.0,
 | 
						.font_size = -1,
 | 
				
			||||||
	.display_invalid_dives = false,
 | 
						.display_invalid_dives = false,
 | 
				
			||||||
	.show_sac = false,
 | 
						.show_sac = false,
 | 
				
			||||||
	.display_unused_tanks = false
 | 
						.display_unused_tanks = false
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue