mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-27 09:50:34 +05:00
0013557: field values display
All related controls for font definition in SMESH and VISU modules have been updated in accordance in changes in QtxFontEdit and related preferences functionality. QtxFontEdit class and related controls in preferences has been updated in order to support custom fonts instead of system fonts only. For example VTK viewer uses only three fonts Arial, Courier and Times. As result there is no point in providing control with system fonts for VTK viewer. Also ?S? button has been added in QtxFontEdit in order to provide ?Shadow? style of VTK font. ?1underline? property of QFont is replaced with ?overline? property in order to store ?Shadow? status of font to avoid conflict simultaneous usage of ?U? and ?S? button.
This commit is contained in:
parent
3dcf003eec
commit
75d312c765
@ -1875,11 +1875,18 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case 810: // Union Groups
|
case 810: // Union Groups
|
||||||
case 811: // Intersect groups
|
case 811: // Intersect groups
|
||||||
case 812: // Cut groups
|
case 812: // Cut groups
|
||||||
{
|
{
|
||||||
|
if ( !vtkwnd )
|
||||||
|
{
|
||||||
|
SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
|
||||||
|
tr( "NOT_A_VTK_VIEWER" ) );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if ( checkLock( aStudy ) )
|
if ( checkLock( aStudy ) )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -2932,8 +2939,6 @@ void SMESHGUI::initialize( CAM_Application* app )
|
|||||||
// popup for object browser
|
// popup for object browser
|
||||||
|
|
||||||
createPopupItem( 150, OB, mesh, "&& selcount=1 && isImported" ); // FILE INFORMATION
|
createPopupItem( 150, OB, mesh, "&& selcount=1 && isImported" ); // FILE INFORMATION
|
||||||
createPopupItem( 703, OB, mesh, "&& isComputable"); // CREATE_SUBMESH
|
|
||||||
createPopupItem( 703, OB, subMesh, "&& isComputable" ); // CREATE_SUBMESH
|
|
||||||
createPopupItem( 704, OB, mesh, "&& isComputable"); // EDIT_MESHSUBMESH
|
createPopupItem( 704, OB, mesh, "&& isComputable"); // EDIT_MESHSUBMESH
|
||||||
createPopupItem( 704, OB, subMesh, "&& isComputable" ); // EDIT_MESHSUBMESH
|
createPopupItem( 704, OB, subMesh, "&& isComputable" ); // EDIT_MESHSUBMESH
|
||||||
createPopupItem( 803, OB, group ); // EDIT_GROUP
|
createPopupItem( 803, OB, group ); // EDIT_GROUP
|
||||||
@ -3462,24 +3467,12 @@ void SMESHGUI::createPreferences()
|
|||||||
int fontGr = addPreference( tr( "SMESH_FONT_SCALARBAR" ), sbarTab );
|
int fontGr = addPreference( tr( "SMESH_FONT_SCALARBAR" ), sbarTab );
|
||||||
setPreferenceProperty( fontGr, "columns", 2 );
|
setPreferenceProperty( fontGr, "columns", 2 );
|
||||||
|
|
||||||
int tfont = addPreference( tr( "SMESH_TITLE" ), fontGr, LightApp_Preferences::Font, "SMESH", "scalar_bar_title_font" );
|
addVtkFontPref( tr( "SMESH_TITLE" ), fontGr, "scalar_bar_title_font" );
|
||||||
addPreference( tr( "PREF_TITLE_COLOR" ), fontGr, LightApp_Preferences::Color, "SMESH", "scalar_bar_title_color" );
|
addPreference( tr( "PREF_TITLE_COLOR" ), fontGr, LightApp_Preferences::Color, "SMESH", "scalar_bar_title_color" );
|
||||||
int lfont = addPreference( tr( "SMESH_LABELS" ), fontGr, LightApp_Preferences::Font, "SMESH", "scalar_bar_label_font" );
|
|
||||||
|
addVtkFontPref( tr( "SMESH_LABELS" ), fontGr, "scalar_bar_label_font" );
|
||||||
addPreference( tr( "PREF_LABELS_COLOR" ), fontGr, LightApp_Preferences::Color, "SMESH", "scalar_bar_label_color" );
|
addPreference( tr( "PREF_LABELS_COLOR" ), fontGr, LightApp_Preferences::Color, "SMESH", "scalar_bar_label_color" );
|
||||||
|
|
||||||
QStringList fam;
|
|
||||||
fam.append( tr( "SMESH_FONT_ARIAL" ) );
|
|
||||||
fam.append( tr( "SMESH_FONT_COURIER" ) );
|
|
||||||
fam.append( tr( "SMESH_FONT_TIMES" ) );
|
|
||||||
int wflag = ( QtxFontEdit::Family | QtxFontEdit::Scripting );
|
|
||||||
|
|
||||||
setPreferenceProperty( tfont, "families", fam );
|
|
||||||
setPreferenceProperty( tfont, "system", false );
|
|
||||||
setPreferenceProperty( tfont, "widget_flags", wflag );
|
|
||||||
setPreferenceProperty( lfont, "families", fam );
|
|
||||||
setPreferenceProperty( lfont, "system", false );
|
|
||||||
setPreferenceProperty( lfont, "widget_flags", wflag );
|
|
||||||
|
|
||||||
int colorsLabelsGr = addPreference( tr( "SMESH_LABELS_COLORS_SCALARBAR" ), sbarTab );
|
int colorsLabelsGr = addPreference( tr( "SMESH_LABELS_COLORS_SCALARBAR" ), sbarTab );
|
||||||
setPreferenceProperty( colorsLabelsGr, "columns", 2 );
|
setPreferenceProperty( colorsLabelsGr, "columns", 2 );
|
||||||
|
|
||||||
@ -4188,3 +4181,35 @@ void SMESHGUI::restoreVisualParameters (int savePoint)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief Adds preferences for dfont of VTK viewer
|
||||||
|
\param label label
|
||||||
|
\param pIf group identifier
|
||||||
|
\param param parameter
|
||||||
|
\return identifier of preferences
|
||||||
|
*/
|
||||||
|
int SMESHGUI::addVtkFontPref( const QString& label, const int pId, const QString& param )
|
||||||
|
{
|
||||||
|
int tfont = addPreference( label, pId, LightApp_Preferences::Font, "VISU", param );
|
||||||
|
|
||||||
|
setPreferenceProperty( tfont, "mode", QtxFontEdit::Custom );
|
||||||
|
|
||||||
|
QStringList fam;
|
||||||
|
fam.append( tr( "SMESH_FONT_ARIAL" ) );
|
||||||
|
fam.append( tr( "SMESH_FONT_COURIER" ) );
|
||||||
|
fam.append( tr( "SMESH_FONT_TIMES" ) );
|
||||||
|
|
||||||
|
setPreferenceProperty( tfont, "fonts", fam );
|
||||||
|
|
||||||
|
int f = QtxFontEdit::Family | QtxFontEdit::Bold | QtxFontEdit::Italic | QtxFontEdit::Shadow;
|
||||||
|
setPreferenceProperty( tfont, "features", f );
|
||||||
|
|
||||||
|
return tfont;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -149,6 +149,9 @@ protected:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void OnEditDelete();
|
void OnEditDelete();
|
||||||
|
int addVtkFontPref( const QString& label,
|
||||||
|
const int pId,
|
||||||
|
const QString& param );
|
||||||
|
|
||||||
private :
|
private :
|
||||||
static SMESH::SMESH_Gen_var myComponentSMESH;
|
static SMESH::SMESH_Gen_var myComponentSMESH;
|
||||||
|
@ -314,7 +314,7 @@ SMESHGUI_Preferences_ScalarBarDlg::SMESHGUI_Preferences_ScalarBarDlg( SMESHGUI*
|
|||||||
|
|
||||||
myTitleBoldCheck->setChecked ( f.bold() );
|
myTitleBoldCheck->setChecked ( f.bold() );
|
||||||
myTitleItalicCheck->setChecked( f.italic() );
|
myTitleItalicCheck->setChecked( f.italic() );
|
||||||
myTitleShadowCheck->setChecked( f.underline() );
|
myTitleShadowCheck->setChecked( f.overline() );
|
||||||
}
|
}
|
||||||
|
|
||||||
QColor labelColor = mgr->colorValue("SMESH", "scalar_bar_label_color",
|
QColor labelColor = mgr->colorValue("SMESH", "scalar_bar_label_color",
|
||||||
@ -332,7 +332,7 @@ SMESHGUI_Preferences_ScalarBarDlg::SMESHGUI_Preferences_ScalarBarDlg( SMESHGUI*
|
|||||||
|
|
||||||
myLabelsBoldCheck ->setChecked( f.bold() );
|
myLabelsBoldCheck ->setChecked( f.bold() );
|
||||||
myLabelsItalicCheck->setChecked( f.italic() );
|
myLabelsItalicCheck->setChecked( f.italic() );
|
||||||
myLabelsShadowCheck->setChecked( f.underline() );
|
myLabelsShadowCheck->setChecked( f.overline() );
|
||||||
}
|
}
|
||||||
|
|
||||||
int aNbColors = mgr->integerValue("SMESH", "scalar_bar_num_colors", 64);
|
int aNbColors = mgr->integerValue("SMESH", "scalar_bar_num_colors", 64);
|
||||||
|
Loading…
Reference in New Issue
Block a user