diff --git a/common/bitmap_info.cpp b/common/bitmap_info.cpp index 9e072e44d3..01a9958c37 100644 --- a/common/bitmap_info.cpp +++ b/common/bitmap_info.cpp @@ -448,6 +448,8 @@ void BuildBitmapInfo( std::unordered_map>& aBi aBitmapInfoCache[BITMAPS::convert].emplace_back( BITMAPS::convert, wxT( "convert_24.png" ), 24, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::copy].emplace_back( BITMAPS::copy, wxT( "copy_24.png" ), 24, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::copy_pad_settings].emplace_back( BITMAPS::copy_pad_settings, wxT( "copy_pad_settings_24.png" ), 24, wxT( "light" ) ); + aBitmapInfoCache[BITMAPS::cursor_fullscreen].emplace_back( BITMAPS::cursor_fullscreen, wxT( "cursor_fullscreen_24.png" ), 24, wxT( "light" ) ); + aBitmapInfoCache[BITMAPS::cursor_fullscreen45].emplace_back( BITMAPS::cursor_fullscreen45, wxT( "cursor_fullscreen45_24.png" ), 24, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::cursor_shape].emplace_back( BITMAPS::cursor_shape, wxT( "cursor_shape_24.png" ), 24, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::cursor].emplace_back( BITMAPS::cursor, wxT( "cursor_24.png" ), 24, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::custom_pad_to_primitives].emplace_back( BITMAPS::custom_pad_to_primitives, wxT( "custom_pad_to_primitives_24.png" ), 24, wxT( "light" ) ); @@ -885,6 +887,8 @@ void BuildBitmapInfo( std::unordered_map>& aBi aBitmapInfoCache[BITMAPS::convert].emplace_back( BITMAPS::convert, wxT( "convert_dark_24.png" ), 24, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::copy].emplace_back( BITMAPS::copy, wxT( "copy_dark_24.png" ), 24, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::copy_pad_settings].emplace_back( BITMAPS::copy_pad_settings, wxT( "copy_pad_settings_dark_24.png" ), 24, wxT( "dark" ) ); + aBitmapInfoCache[BITMAPS::cursor_fullscreen].emplace_back( BITMAPS::cursor_fullscreen, wxT( "cursor_fullscreen_dark_24.png" ), 24, wxT( "dark" ) ); + aBitmapInfoCache[BITMAPS::cursor_fullscreen45].emplace_back( BITMAPS::cursor_fullscreen45, wxT( "cursor_fullscreen45_dark_24.png" ), 24, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::cursor_shape].emplace_back( BITMAPS::cursor_shape, wxT( "cursor_shape_dark_24.png" ), 24, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::cursor].emplace_back( BITMAPS::cursor, wxT( "cursor_dark_24.png" ), 24, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::custom_pad_to_primitives].emplace_back( BITMAPS::custom_pad_to_primitives, wxT( "custom_pad_to_primitives_dark_24.png" ), 24, wxT( "dark" ) ); @@ -1322,6 +1326,8 @@ void BuildBitmapInfo( std::unordered_map>& aBi aBitmapInfoCache[BITMAPS::convert].emplace_back( BITMAPS::convert, wxT( "convert_16.png" ), 16, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::copy].emplace_back( BITMAPS::copy, wxT( "copy_16.png" ), 16, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::copy_pad_settings].emplace_back( BITMAPS::copy_pad_settings, wxT( "copy_pad_settings_16.png" ), 16, wxT( "light" ) ); + aBitmapInfoCache[BITMAPS::cursor_fullscreen].emplace_back( BITMAPS::cursor_fullscreen, wxT( "cursor_fullscreen_16.png" ), 16, wxT( "light" ) ); + aBitmapInfoCache[BITMAPS::cursor_fullscreen45].emplace_back( BITMAPS::cursor_fullscreen45, wxT( "cursor_fullscreen45_16.png" ), 16, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::cursor_shape].emplace_back( BITMAPS::cursor_shape, wxT( "cursor_shape_16.png" ), 16, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::cursor].emplace_back( BITMAPS::cursor, wxT( "cursor_16.png" ), 16, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::custom_pad_to_primitives].emplace_back( BITMAPS::custom_pad_to_primitives, wxT( "custom_pad_to_primitives_16.png" ), 16, wxT( "light" ) ); @@ -1759,6 +1765,8 @@ void BuildBitmapInfo( std::unordered_map>& aBi aBitmapInfoCache[BITMAPS::convert].emplace_back( BITMAPS::convert, wxT( "convert_dark_16.png" ), 16, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::copy].emplace_back( BITMAPS::copy, wxT( "copy_dark_16.png" ), 16, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::copy_pad_settings].emplace_back( BITMAPS::copy_pad_settings, wxT( "copy_pad_settings_dark_16.png" ), 16, wxT( "dark" ) ); + aBitmapInfoCache[BITMAPS::cursor_fullscreen].emplace_back( BITMAPS::cursor_fullscreen, wxT( "cursor_fullscreen_dark_16.png" ), 16, wxT( "dark" ) ); + aBitmapInfoCache[BITMAPS::cursor_fullscreen45].emplace_back( BITMAPS::cursor_fullscreen45, wxT( "cursor_fullscreen45_dark_16.png" ), 16, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::cursor_shape].emplace_back( BITMAPS::cursor_shape, wxT( "cursor_shape_dark_16.png" ), 16, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::cursor].emplace_back( BITMAPS::cursor, wxT( "cursor_dark_16.png" ), 16, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::custom_pad_to_primitives].emplace_back( BITMAPS::custom_pad_to_primitives, wxT( "custom_pad_to_primitives_dark_16.png" ), 16, wxT( "dark" ) ); @@ -2196,6 +2204,8 @@ void BuildBitmapInfo( std::unordered_map>& aBi aBitmapInfoCache[BITMAPS::convert].emplace_back( BITMAPS::convert, wxT( "convert_32.png" ), 32, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::copy].emplace_back( BITMAPS::copy, wxT( "copy_32.png" ), 32, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::copy_pad_settings].emplace_back( BITMAPS::copy_pad_settings, wxT( "copy_pad_settings_32.png" ), 32, wxT( "light" ) ); + aBitmapInfoCache[BITMAPS::cursor_fullscreen].emplace_back( BITMAPS::cursor_fullscreen, wxT( "cursor_fullscreen_32.png" ), 32, wxT( "light" ) ); + aBitmapInfoCache[BITMAPS::cursor_fullscreen45].emplace_back( BITMAPS::cursor_fullscreen45, wxT( "cursor_fullscreen45_32.png" ), 32, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::cursor_shape].emplace_back( BITMAPS::cursor_shape, wxT( "cursor_shape_32.png" ), 32, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::cursor].emplace_back( BITMAPS::cursor, wxT( "cursor_32.png" ), 32, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::custom_pad_to_primitives].emplace_back( BITMAPS::custom_pad_to_primitives, wxT( "custom_pad_to_primitives_32.png" ), 32, wxT( "light" ) ); @@ -2633,6 +2643,8 @@ void BuildBitmapInfo( std::unordered_map>& aBi aBitmapInfoCache[BITMAPS::convert].emplace_back( BITMAPS::convert, wxT( "convert_dark_32.png" ), 32, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::copy].emplace_back( BITMAPS::copy, wxT( "copy_dark_32.png" ), 32, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::copy_pad_settings].emplace_back( BITMAPS::copy_pad_settings, wxT( "copy_pad_settings_dark_32.png" ), 32, wxT( "dark" ) ); + aBitmapInfoCache[BITMAPS::cursor_fullscreen].emplace_back( BITMAPS::cursor_fullscreen, wxT( "cursor_fullscreen_dark_32.png" ), 32, wxT( "dark" ) ); + aBitmapInfoCache[BITMAPS::cursor_fullscreen45].emplace_back( BITMAPS::cursor_fullscreen45, wxT( "cursor_fullscreen45_dark_32.png" ), 32, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::cursor_shape].emplace_back( BITMAPS::cursor_shape, wxT( "cursor_shape_dark_32.png" ), 32, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::cursor].emplace_back( BITMAPS::cursor, wxT( "cursor_dark_32.png" ), 32, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::custom_pad_to_primitives].emplace_back( BITMAPS::custom_pad_to_primitives, wxT( "custom_pad_to_primitives_dark_32.png" ), 32, wxT( "dark" ) ); @@ -3070,6 +3082,8 @@ void BuildBitmapInfo( std::unordered_map>& aBi aBitmapInfoCache[BITMAPS::convert].emplace_back( BITMAPS::convert, wxT( "convert_48.png" ), 48, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::copy].emplace_back( BITMAPS::copy, wxT( "copy_48.png" ), 48, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::copy_pad_settings].emplace_back( BITMAPS::copy_pad_settings, wxT( "copy_pad_settings_48.png" ), 48, wxT( "light" ) ); + aBitmapInfoCache[BITMAPS::cursor_fullscreen].emplace_back( BITMAPS::cursor_fullscreen, wxT( "cursor_fullscreen_48.png" ), 48, wxT( "light" ) ); + aBitmapInfoCache[BITMAPS::cursor_fullscreen45].emplace_back( BITMAPS::cursor_fullscreen45, wxT( "cursor_fullscreen45_48.png" ), 48, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::cursor_shape].emplace_back( BITMAPS::cursor_shape, wxT( "cursor_shape_48.png" ), 48, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::cursor].emplace_back( BITMAPS::cursor, wxT( "cursor_48.png" ), 48, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::custom_pad_to_primitives].emplace_back( BITMAPS::custom_pad_to_primitives, wxT( "custom_pad_to_primitives_48.png" ), 48, wxT( "light" ) ); @@ -3507,6 +3521,8 @@ void BuildBitmapInfo( std::unordered_map>& aBi aBitmapInfoCache[BITMAPS::convert].emplace_back( BITMAPS::convert, wxT( "convert_dark_48.png" ), 48, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::copy].emplace_back( BITMAPS::copy, wxT( "copy_dark_48.png" ), 48, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::copy_pad_settings].emplace_back( BITMAPS::copy_pad_settings, wxT( "copy_pad_settings_dark_48.png" ), 48, wxT( "dark" ) ); + aBitmapInfoCache[BITMAPS::cursor_fullscreen].emplace_back( BITMAPS::cursor_fullscreen, wxT( "cursor_fullscreen_dark_48.png" ), 48, wxT( "dark" ) ); + aBitmapInfoCache[BITMAPS::cursor_fullscreen45].emplace_back( BITMAPS::cursor_fullscreen45, wxT( "cursor_fullscreen45_dark_48.png" ), 48, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::cursor_shape].emplace_back( BITMAPS::cursor_shape, wxT( "cursor_shape_dark_48.png" ), 48, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::cursor].emplace_back( BITMAPS::cursor, wxT( "cursor_dark_48.png" ), 48, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::custom_pad_to_primitives].emplace_back( BITMAPS::custom_pad_to_primitives, wxT( "custom_pad_to_primitives_dark_48.png" ), 48, wxT( "dark" ) ); @@ -3944,6 +3960,8 @@ void BuildBitmapInfo( std::unordered_map>& aBi aBitmapInfoCache[BITMAPS::convert].emplace_back( BITMAPS::convert, wxT( "convert_64.png" ), 64, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::copy].emplace_back( BITMAPS::copy, wxT( "copy_64.png" ), 64, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::copy_pad_settings].emplace_back( BITMAPS::copy_pad_settings, wxT( "copy_pad_settings_64.png" ), 64, wxT( "light" ) ); + aBitmapInfoCache[BITMAPS::cursor_fullscreen].emplace_back( BITMAPS::cursor_fullscreen, wxT( "cursor_fullscreen_64.png" ), 64, wxT( "light" ) ); + aBitmapInfoCache[BITMAPS::cursor_fullscreen45].emplace_back( BITMAPS::cursor_fullscreen45, wxT( "cursor_fullscreen45_64.png" ), 64, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::cursor_shape].emplace_back( BITMAPS::cursor_shape, wxT( "cursor_shape_64.png" ), 64, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::cursor].emplace_back( BITMAPS::cursor, wxT( "cursor_64.png" ), 64, wxT( "light" ) ); aBitmapInfoCache[BITMAPS::custom_pad_to_primitives].emplace_back( BITMAPS::custom_pad_to_primitives, wxT( "custom_pad_to_primitives_64.png" ), 64, wxT( "light" ) ); @@ -4381,6 +4399,8 @@ void BuildBitmapInfo( std::unordered_map>& aBi aBitmapInfoCache[BITMAPS::convert].emplace_back( BITMAPS::convert, wxT( "convert_dark_64.png" ), 64, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::copy].emplace_back( BITMAPS::copy, wxT( "copy_dark_64.png" ), 64, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::copy_pad_settings].emplace_back( BITMAPS::copy_pad_settings, wxT( "copy_pad_settings_dark_64.png" ), 64, wxT( "dark" ) ); + aBitmapInfoCache[BITMAPS::cursor_fullscreen].emplace_back( BITMAPS::cursor_fullscreen, wxT( "cursor_fullscreen_dark_64.png" ), 64, wxT( "dark" ) ); + aBitmapInfoCache[BITMAPS::cursor_fullscreen45].emplace_back( BITMAPS::cursor_fullscreen45, wxT( "cursor_fullscreen45_dark_64.png" ), 64, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::cursor_shape].emplace_back( BITMAPS::cursor_shape, wxT( "cursor_shape_dark_64.png" ), 64, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::cursor].emplace_back( BITMAPS::cursor, wxT( "cursor_dark_64.png" ), 64, wxT( "dark" ) ); aBitmapInfoCache[BITMAPS::custom_pad_to_primitives].emplace_back( BITMAPS::custom_pad_to_primitives, wxT( "custom_pad_to_primitives_dark_64.png" ), 64, wxT( "dark" ) ); diff --git a/common/gal/cairo/cairo_gal.cpp b/common/gal/cairo/cairo_gal.cpp index b7836722e6..85006603ac 100644 --- a/common/gal/cairo/cairo_gal.cpp +++ b/common/gal/cairo/cairo_gal.cpp @@ -1203,11 +1203,20 @@ void CAIRO_GAL_BASE::blitCursor( wxMemoryDC& clientDC ) 255 ); clientDC.SetPen( wxPen( color ) ); - if( m_fullscreenCursor ) + if( m_crossHairMode == CROSS_HAIR_MODE::FULLSCREEN_CROSS ) { clientDC.DrawLine( 0, p.y, m_screenSize.x, p.y ); clientDC.DrawLine( p.x, 0, p.x, m_screenSize.y ); } + else if( m_crossHairMode == CROSS_HAIR_MODE::FULLSCREEN_DIAGONAL ) + { + // Oversized but that's ok + int diagonalSize = m_screenSize.x + m_screenSize.y; + clientDC.DrawLine( p.x - diagonalSize, p.y - diagonalSize, + p.x + diagonalSize, p.y + diagonalSize ); + clientDC.DrawLine( p.x - diagonalSize, p.y + diagonalSize, + p.x + diagonalSize, p.y - diagonalSize ); + } else { const int cursorSize = 80; diff --git a/common/gal/gal_display_options.cpp b/common/gal/gal_display_options.cpp index 4ba7e25588..df8af0e386 100644 --- a/common/gal/gal_display_options.cpp +++ b/common/gal/gal_display_options.cpp @@ -50,7 +50,7 @@ GAL_DISPLAY_OPTIONS::GAL_DISPLAY_OPTIONS() m_gridLineWidth( 1.0 ), m_gridMinSpacing( 10.0 ), m_axesEnabled( false ), - m_fullscreenCursor( false ), + m_crossHairMode( CROSS_HAIR_MODE::SMALL_CROSS ), m_forceDisplayCursor( false ), m_scaleFactor( DPI_SCALING::GetDefaultScaleFactor() ) { diff --git a/common/gal/graphics_abstraction_layer.cpp b/common/gal/graphics_abstraction_layer.cpp index 6420870795..44049634c9 100644 --- a/common/gal/graphics_abstraction_layer.cpp +++ b/common/gal/graphics_abstraction_layer.cpp @@ -79,7 +79,7 @@ GAL::GAL( GAL_DISPLAY_OPTIONS& aDisplayOptions ) : // Initialize the cursor shape SetCursorColor( COLOR4D( 1.0, 1.0, 1.0, 1.0 ) ); - m_fullscreenCursor = false; + m_crossHairMode = CROSS_HAIR_MODE::SMALL_CROSS; m_forceDisplayCursor = false; SetCursorEnabled( false ); @@ -142,9 +142,9 @@ bool GAL::updatedGalDisplayOptions( const GAL_DISPLAY_OPTIONS& aOptions ) refresh = true; } - if( m_options.m_fullscreenCursor != m_fullscreenCursor ) + if( m_options.GetCursorMode() != m_crossHairMode ) { - m_fullscreenCursor = m_options.m_fullscreenCursor; + m_crossHairMode = m_options.GetCursorMode(); refresh = true; } diff --git a/common/gal/opengl/opengl_gal.cpp b/common/gal/opengl/opengl_gal.cpp index 4e823a9f0f..22a08a1bd1 100644 --- a/common/gal/opengl/opengl_gal.cpp +++ b/common/gal/opengl/opengl_gal.cpp @@ -2648,12 +2648,12 @@ void OPENGL_GAL::blitCursor() VECTOR2D cursorEnd; VECTOR2D cursorCenter = m_cursorPosition; - if( m_fullscreenCursor ) + if( m_crossHairMode == CROSS_HAIR_MODE::FULLSCREEN_CROSS ) { cursorBegin = m_screenWorldMatrix * VECTOR2D( 0.0, 0.0 ); cursorEnd = m_screenWorldMatrix * VECTOR2D( m_screenSize ); } - else + else if( m_crossHairMode == CROSS_HAIR_MODE::SMALL_CROSS ) { const int cursorSize = 80; cursorBegin = m_cursorPosition - cursorSize / ( 2 * m_worldScale ); @@ -2671,11 +2671,46 @@ void OPENGL_GAL::blitCursor() glColor4d( color.r, color.g, color.b, color.a ); glBegin( GL_LINES ); - glVertex2d( cursorCenter.x, cursorBegin.y ); - glVertex2d( cursorCenter.x, cursorEnd.y ); - glVertex2d( cursorBegin.x, cursorCenter.y ); - glVertex2d( cursorEnd.x, cursorCenter.y ); + if( m_crossHairMode == CROSS_HAIR_MODE::FULLSCREEN_DIAGONAL ) + { + // Calculate screen bounds in world coordinates + VECTOR2D screenTopLeft = m_screenWorldMatrix * VECTOR2D( 0.0, 0.0 ); + VECTOR2D screenBottomRight = m_screenWorldMatrix * VECTOR2D( m_screenSize ); + + // For 45-degree lines passing through cursor position + // Line equation: y = x + (cy - cx) for positive slope + // Line equation: y = -x + (cy + cx) for negative slope + double cx = m_cursorPosition.x; + double cy = m_cursorPosition.y; + + // Calculate intersections for positive slope diagonal (y = x + offset) + double offset1 = cy - cx; + VECTOR2D pos_start( screenTopLeft.x, screenTopLeft.x + offset1 ); + VECTOR2D pos_end( screenBottomRight.x, screenBottomRight.x + offset1 ); + + // Draw positive slope diagonal + glVertex2d( pos_start.x, pos_start.y ); + glVertex2d( pos_end.x, pos_end.y ); + + // Calculate intersections for negative slope diagonal (y = -x + offset) + double offset2 = cy + cx; + VECTOR2D neg_start( screenTopLeft.x, offset2 - screenTopLeft.x ); + VECTOR2D neg_end( screenBottomRight.x, offset2 - screenBottomRight.x ); + + // Draw negative slope diagonal + glVertex2d( neg_start.x, neg_start.y ); + glVertex2d( neg_end.x, neg_end.y ); + } + else + { + glVertex2d( cursorCenter.x, cursorBegin.y ); + glVertex2d( cursorCenter.x, cursorEnd.y ); + + glVertex2d( cursorBegin.x, cursorCenter.y ); + glVertex2d( cursorEnd.x, cursorCenter.y ); + } + glEnd(); } diff --git a/common/gal_display_options_common.cpp b/common/gal_display_options_common.cpp index f45531a4ca..115201e527 100644 --- a/common/gal_display_options_common.cpp +++ b/common/gal_display_options_common.cpp @@ -71,7 +71,7 @@ void GAL_DISPLAY_OPTIONS_IMPL::ReadWindowSettings( WINDOW_SETTINGS& aCfg ) m_gridMinSpacing = aCfg.grid.min_spacing; m_axesEnabled = aCfg.grid.axes_enabled; - m_fullscreenCursor = aCfg.cursor.fullscreen_cursor; + m_crossHairMode = aCfg.cursor.cross_hair_mode; m_forceDisplayCursor = aCfg.cursor.always_show_cursor; NotifyChanged(); @@ -112,7 +112,7 @@ void GAL_DISPLAY_OPTIONS_IMPL::WriteConfig( WINDOW_SETTINGS& aCfg ) aCfg.grid.line_width = m_gridLineWidth; aCfg.grid.min_spacing = m_gridMinSpacing; aCfg.grid.axes_enabled = m_axesEnabled; - aCfg.cursor.fullscreen_cursor = m_fullscreenCursor; + aCfg.cursor.cross_hair_mode = m_crossHairMode; aCfg.cursor.always_show_cursor = m_forceDisplayCursor; } diff --git a/common/settings/app_settings.cpp b/common/settings/app_settings.cpp index e53b064024..1ae7f19883 100644 --- a/common/settings/app_settings.cpp +++ b/common/settings/app_settings.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -386,8 +387,8 @@ bool APP_SETTINGS_BASE::migrateWindowConfig( wxConfigBase* aCfg, const std::stri ret &= fromLegacy( aCfg, frameGDO + "ForceDisplayCursor", cursorPath + ".always_show_cursor" ); - ret &= fromLegacy( aCfg, frameGDO + "CursorFullscreen", - cursorPath + ".fullscreen_cursor" ); + ret &= fromLegacy( aCfg, frameGDO + "CursorFullscreen", + cursorPath + ".cross_hair_mode" ); ret &= fromLegacy( aCfg, aFrame + "_LastGridSize", gridPath + ".last_size" ); @@ -539,8 +540,8 @@ void APP_SETTINGS_BASE::addParamsForWindow( WINDOW_SETTINGS* aWindow, const std: m_params.emplace_back( new PARAM( aJsonPath + ".cursor.always_show_cursor", &aWindow->cursor.always_show_cursor, true ) ); - m_params.emplace_back( new PARAM( aJsonPath + ".cursor.fullscreen_cursor", - &aWindow->cursor.fullscreen_cursor, false ) ); + m_params.emplace_back( new PARAM( aJsonPath + ".cursor.cross_hair_mode", + &aWindow->cursor.cross_hair_mode, KIGFX::CROSS_HAIR_MODE::SMALL_CROSS ) ); } diff --git a/common/settings/json_settings.cpp b/common/settings/json_settings.cpp index ceed7a6375..c31b976ded 100644 --- a/common/settings/json_settings.cpp +++ b/common/settings/json_settings.cpp @@ -651,6 +651,8 @@ template KICOMMON_API std::optional JSON_SETTINGS::Get( const std::string& aPath ) const; template KICOMMON_API std::optional JSON_SETTINGS::Get( const std::string& aPath ) const; +template KICOMMON_API std::optional + JSON_SETTINGS::Get( const std::string& aPath ) const; template void JSON_SETTINGS::Set( const std::string& aPath, ValueType aVal ) @@ -688,6 +690,8 @@ template KICOMMON_API void JSON_SETTINGS::Set( const std::string& aPath, template KICOMMON_API void JSON_SETTINGS::Set( const std::string& aPath, wxRect aValue ); template KICOMMON_API void JSON_SETTINGS::Set( const std::string& aPath, wxAuiPaneInfo aValue ); +template KICOMMON_API void JSON_SETTINGS::Set( const std::string& aPath, + KIGFX::CROSS_HAIR_MODE aValue ); void JSON_SETTINGS::registerMigration( int aOldSchemaVersion, int aNewSchemaVersion, diff --git a/common/tool/actions.cpp b/common/tool/actions.cpp index cbc3b28734..d81bd835b2 100644 --- a/common/tool/actions.cpp +++ b/common/tool/actions.cpp @@ -1169,14 +1169,30 @@ TOOL_ACTION ACTIONS::toggleCursor( TOOL_ACTION_ARGS() .Tooltip( _( "Display crosshairs even when not drawing objects" ) ) .Icon( BITMAPS::cursor ) ); -TOOL_ACTION ACTIONS::toggleCursorStyle( TOOL_ACTION_ARGS() - .Name( "common.Control.toggleCursorStyle" ) +TOOL_ACTION ACTIONS::cursorSmallCrosshairs( TOOL_ACTION_ARGS() + .Name( "common.Control.cursorSmallCrosshairs" ) .Scope( AS_GLOBAL ) - .FriendlyName( _( "Full-Window Crosshairs" ) ) - .Tooltip( _( "Switch display of full-window crosshairs" ) ) + .FriendlyName( _( "Small crosshairs" ) ) + .Tooltip( _( "Use small crosshairs aligned at 0 and 90 degrees" ) ) .ToolbarState( TOOLBAR_STATE::TOGGLE ) .Icon( BITMAPS::cursor_shape ) ); +TOOL_ACTION ACTIONS::cursorFullCrosshairs( TOOL_ACTION_ARGS() + .Name( "common.Control.cursorFullCrosshairs" ) + .Scope( AS_GLOBAL ) + .FriendlyName( _( "Full-Window Crosshairs" ) ) + .Tooltip( _( "Display full-window crosshairs aligned at 0 and 90 degrees" ) ) + .ToolbarState( TOOLBAR_STATE::TOGGLE ) + .Icon( BITMAPS::cursor_fullscreen ) ); + +TOOL_ACTION ACTIONS::cursor45Crosshairs( TOOL_ACTION_ARGS() + .Name( "common.Control.cursor45Crosshairs" ) + .Scope( AS_GLOBAL ) + .FriendlyName( _( "45 Degree Crosshairs" ) ) + .Tooltip( _( "Display full-window crosshairs aligned at 45 and 135 degrees" ) ) + .ToolbarState( TOOLBAR_STATE::TOGGLE ) + .Icon( BITMAPS::cursor_fullscreen45 ) ); + TOOL_ACTION ACTIONS::highContrastMode( TOOL_ACTION_ARGS() .Name( "common.Control.highContrastMode" ) .Scope( AS_GLOBAL ) diff --git a/common/tool/common_tools.cpp b/common/tool/common_tools.cpp index 785df235b3..d1e753f1a1 100644 --- a/common/tool/common_tools.cpp +++ b/common/tool/common_tools.cpp @@ -710,11 +710,35 @@ int COMMON_TOOLS::ToggleCursor( const TOOL_EVENT& aEvent ) } -int COMMON_TOOLS::ToggleCursorStyle( const TOOL_EVENT& aEvent ) +int COMMON_TOOLS::CursorSmallCrosshairs( const TOOL_EVENT& aEvent ) { GAL_DISPLAY_OPTIONS_IMPL& galOpts = m_frame->GetGalDisplayOptions(); - galOpts.m_fullscreenCursor = !galOpts.m_fullscreenCursor; + galOpts.SetCursorMode( KIGFX::CROSS_HAIR_MODE::SMALL_CROSS ); + galOpts.WriteConfig( *m_frame->GetWindowSettings( m_toolMgr->GetSettings() ) ); + galOpts.NotifyChanged(); + + return 0; +} + + +int COMMON_TOOLS::CursorFullCrosshairs( const TOOL_EVENT& aEvent ) +{ + GAL_DISPLAY_OPTIONS_IMPL& galOpts = m_frame->GetGalDisplayOptions(); + + galOpts.SetCursorMode( KIGFX::CROSS_HAIR_MODE::FULLSCREEN_CROSS ); + galOpts.WriteConfig( *m_frame->GetWindowSettings( m_toolMgr->GetSettings() ) ); + galOpts.NotifyChanged(); + + return 0; +} + + +int COMMON_TOOLS::Cursor45Crosshairs( const TOOL_EVENT& aEvent ) +{ + GAL_DISPLAY_OPTIONS_IMPL& galOpts = m_frame->GetGalDisplayOptions(); + + galOpts.SetCursorMode( KIGFX::CROSS_HAIR_MODE::FULLSCREEN_DIAGONAL ); galOpts.WriteConfig( *m_frame->GetWindowSettings( m_toolMgr->GetSettings() ) ); galOpts.NotifyChanged(); @@ -800,6 +824,8 @@ void COMMON_TOOLS::setTransitions() // Misc Go( &COMMON_TOOLS::ToggleCursor, ACTIONS::toggleCursor.MakeEvent() ); - Go( &COMMON_TOOLS::ToggleCursorStyle, ACTIONS::toggleCursorStyle.MakeEvent() ); + Go( &COMMON_TOOLS::CursorSmallCrosshairs, ACTIONS::cursorSmallCrosshairs.MakeEvent() ); + Go( &COMMON_TOOLS::CursorFullCrosshairs, ACTIONS::cursorFullCrosshairs.MakeEvent() ); + Go( &COMMON_TOOLS::Cursor45Crosshairs, ACTIONS::cursor45Crosshairs.MakeEvent() ); Go( &COMMON_TOOLS::ToggleBoundingBoxes, ACTIONS::toggleBoundingBoxes.MakeEvent() ); } diff --git a/common/tool/editor_conditions.cpp b/common/tool/editor_conditions.cpp index bdfa4aca6b..5eed8b684a 100644 --- a/common/tool/editor_conditions.cpp +++ b/common/tool/editor_conditions.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -106,14 +107,36 @@ SELECTION_CONDITION EDITOR_CONDITIONS::PolarCoordinates() } -SELECTION_CONDITION EDITOR_CONDITIONS::FullscreenCursor() +SELECTION_CONDITION EDITOR_CONDITIONS::CursorSmallCrosshairs() { - // The fullscreen cursor requires a draw frame EDA_DRAW_FRAME* drwFrame = dynamic_cast( m_frame ); wxASSERT( drwFrame ); - return std::bind( &EDITOR_CONDITIONS::cursorFunc, _1, drwFrame ); + return std::bind( &EDITOR_CONDITIONS::cursorFunc, _1, drwFrame, + KIGFX::CROSS_HAIR_MODE::SMALL_CROSS ); +} + + +SELECTION_CONDITION EDITOR_CONDITIONS::CursorFullCrosshairs() +{ + EDA_DRAW_FRAME* drwFrame = dynamic_cast( m_frame ); + + wxASSERT( drwFrame ); + + return std::bind( &EDITOR_CONDITIONS::cursorFunc, _1, drwFrame, + KIGFX::CROSS_HAIR_MODE::FULLSCREEN_CROSS ); +} + + +SELECTION_CONDITION EDITOR_CONDITIONS::Cursor45Crosshairs() +{ + EDA_DRAW_FRAME* drwFrame = dynamic_cast( m_frame ); + + wxASSERT( drwFrame ); + + return std::bind( &EDITOR_CONDITIONS::cursorFunc, _1, drwFrame, + KIGFX::CROSS_HAIR_MODE::FULLSCREEN_DIAGONAL ); } @@ -193,9 +216,10 @@ bool EDITOR_CONDITIONS::polarCoordFunc( const SELECTION& aSelection, EDA_DRAW_FR } -bool EDITOR_CONDITIONS::cursorFunc( const SELECTION& aSelection, EDA_DRAW_FRAME* aFrame ) +bool EDITOR_CONDITIONS::cursorFunc( const SELECTION& aSelection, EDA_DRAW_FRAME* aFrame, + KIGFX::CROSS_HAIR_MODE aMode ) { - return aFrame->GetGalDisplayOptions().m_fullscreenCursor; + return aFrame->GetGalDisplayOptions().GetCursorMode() == aMode; } diff --git a/common/widgets/gal_options_panel.cpp b/common/widgets/gal_options_panel.cpp index f9786bdc45..0e4737713b 100644 --- a/common/widgets/gal_options_panel.cpp +++ b/common/widgets/gal_options_panel.cpp @@ -23,6 +23,7 @@ #include #include +#include #include #include @@ -92,10 +93,12 @@ bool GAL_OPTIONS_PANEL::TransferDataToWindow() m_gridMinSpacing->SetValue( m_cfg->m_Window.grid.min_spacing ); - if( m_cfg->m_Window.cursor.fullscreen_cursor ) - m_rbFullWindowCrosshairs->SetValue( true ); - else + if( m_cfg->m_Window.cursor.cross_hair_mode == KIGFX::CROSS_HAIR_MODE::SMALL_CROSS ) m_rbSmallCrosshairs->SetValue( true ); + else if( m_cfg->m_Window.cursor.cross_hair_mode == KIGFX::CROSS_HAIR_MODE::FULLSCREEN_DIAGONAL ) + m_rb45DegreeCrosshairs->SetValue( true ); + else + m_rbFullWindowCrosshairs->SetValue( true ); m_forceCursorDisplay->SetValue( m_cfg->m_Window.cursor.always_show_cursor ); @@ -119,7 +122,12 @@ bool GAL_OPTIONS_PANEL::TransferDataFromWindow() m_cfg->m_Window.grid.min_spacing = m_gridMinSpacing->GetValue(); - m_cfg->m_Window.cursor.fullscreen_cursor = m_rbFullWindowCrosshairs->GetValue(); + if( m_rbFullWindowCrosshairs->GetValue() ) + m_cfg->m_Window.cursor.cross_hair_mode = KIGFX::CROSS_HAIR_MODE::FULLSCREEN_CROSS; + else if( m_rb45DegreeCrosshairs->GetValue() ) + m_cfg->m_Window.cursor.cross_hair_mode = KIGFX::CROSS_HAIR_MODE::FULLSCREEN_DIAGONAL; + else + m_cfg->m_Window.cursor.cross_hair_mode = KIGFX::CROSS_HAIR_MODE::SMALL_CROSS; m_cfg->m_Window.cursor.always_show_cursor = m_forceCursorDisplay->GetValue(); return true; diff --git a/common/widgets/gal_options_panel_base.cpp b/common/widgets/gal_options_panel_base.cpp index 7b66ddf233..7b53cf7f97 100644 --- a/common/widgets/gal_options_panel_base.cpp +++ b/common/widgets/gal_options_panel_base.cpp @@ -102,8 +102,11 @@ GAL_OPTIONS_PANEL_BASE::GAL_OPTIONS_PANEL_BASE( wxWindow* parent, wxWindowID id, m_rbSmallCrosshairs = new wxRadioButton( this, wxID_ANY, _("Small crosshairs"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); fgSizer1->Add( m_rbSmallCrosshairs, 0, wxTOP|wxLEFT, 5 ); - m_rbFullWindowCrosshairs = new wxRadioButton( this, wxID_ANY, _("Full window crosshairs"), wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer1->Add( m_rbFullWindowCrosshairs, 0, wxLEFT, 5 ); + m_rbFullWindowCrosshairs = new wxRadioButton( this, wxID_ANY, _("Full window crosshairs"), wxDefaultPosition, wxDefaultSize, 0 ); + fgSizer1->Add( m_rbFullWindowCrosshairs, 0, wxLEFT, 5 ); + + m_rb45DegreeCrosshairs = new wxRadioButton( this, wxID_ANY, _("45 degree crosshairs"), wxDefaultPosition, wxDefaultSize, 0 ); + fgSizer1->Add( m_rb45DegreeCrosshairs, 0, wxLEFT, 5 ); fgSizer1->Add( 0, 8, 0, wxEXPAND, 5 ); diff --git a/common/widgets/gal_options_panel_base.fbp b/common/widgets/gal_options_panel_base.fbp index b04bacc20d..7022388d96 100644 --- a/common/widgets/gal_options_panel_base.fbp +++ b/common/widgets/gal_options_panel_base.fbp @@ -1267,6 +1267,71 @@ 0 + + + + + 5 + wxLEFT + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + 45 degree crosshairs + + 0 + + + 0 + + 1 + m_rb45DegreeCrosshairs + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + 0 + + diff --git a/common/widgets/gal_options_panel_base.h b/common/widgets/gal_options_panel_base.h index 42bc7da6a3..455ab473fc 100644 --- a/common/widgets/gal_options_panel_base.h +++ b/common/widgets/gal_options_panel_base.h @@ -51,9 +51,10 @@ class GAL_OPTIONS_PANEL_BASE : public wxPanel wxChoice* m_gridSnapOptions; wxStaticText* m_stGridLabel; wxStaticLine* m_staticline2; - wxRadioButton* m_rbSmallCrosshairs; - wxRadioButton* m_rbFullWindowCrosshairs; - wxCheckBox* m_forceCursorDisplay; + wxRadioButton* m_rbSmallCrosshairs; + wxRadioButton* m_rbFullWindowCrosshairs; + wxRadioButton* m_rb45DegreeCrosshairs; + wxCheckBox* m_forceCursorDisplay; public: diff --git a/cvpcb/display_footprints_frame.cpp b/cvpcb/display_footprints_frame.cpp index b6c9d33fc0..158c9c5298 100644 --- a/cvpcb/display_footprints_frame.cpp +++ b/cvpcb/display_footprints_frame.cpp @@ -198,7 +198,9 @@ void DISPLAY_FOOTPRINTS_FRAME::setupUIConditions() mgr->SetConditions( ACTIONS::measureTool, CHECK( cond.CurrentTool( ACTIONS::measureTool ) ) ); mgr->SetConditions( ACTIONS::toggleGrid, CHECK( cond.GridVisible() ) ); - mgr->SetConditions( ACTIONS::toggleCursorStyle, CHECK( cond.FullscreenCursor() ) ); + mgr->SetConditions( ACTIONS::cursorSmallCrosshairs, CHECK( cond.CursorSmallCrosshairs() ) ); + mgr->SetConditions( ACTIONS::cursorFullCrosshairs, CHECK( cond.CursorFullCrosshairs() ) ); + mgr->SetConditions( ACTIONS::cursor45Crosshairs, CHECK( cond.Cursor45Crosshairs() ) ); mgr->SetConditions( ACTIONS::millimetersUnits, CHECK( cond.Units( EDA_UNITS::MM ) ) ); mgr->SetConditions( ACTIONS::inchesUnits, CHECK( cond.Units( EDA_UNITS::INCH ) ) ); diff --git a/cvpcb/toolbars_display_footprints.cpp b/cvpcb/toolbars_display_footprints.cpp index 1d791ba6ab..6f176551a8 100644 --- a/cvpcb/toolbars_display_footprints.cpp +++ b/cvpcb/toolbars_display_footprints.cpp @@ -46,7 +46,10 @@ std::optional DISPLAY_FOOTPRINTS_TOOLBAR_SETTINGS::Defaul .AppendAction( ACTIONS::inchesUnits ) .AppendAction( ACTIONS::milsUnits ) .AppendAction( ACTIONS::millimetersUnits ) - .AppendAction( ACTIONS::toggleCursorStyle ); + .AppendGroup( TOOLBAR_GROUP_CONFIG( _( "Crosshair modes" ) ) + .AddAction( ACTIONS::cursorSmallCrosshairs ) + .AddAction( ACTIONS::cursorFullCrosshairs ) + .AddAction( ACTIONS::cursor45Crosshairs ) ); config.AppendSeparator() .AppendAction( PCB_ACTIONS::showPadNumbers ) diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp index 374e564689..a7ba2a6071 100644 --- a/eeschema/sch_edit_frame.cpp +++ b/eeschema/sch_edit_frame.cpp @@ -637,7 +637,9 @@ void SCH_EDIT_FRAME::setupUIConditions() mgr->SetConditions( SCH_ACTIONS::showDesignBlockPanel, CHECK( designBlockCond ) ); mgr->SetConditions( ACTIONS::toggleGrid, CHECK( cond.GridVisible() ) ); mgr->SetConditions( ACTIONS::toggleGridOverrides, CHECK( cond.GridOverrides() ) ); - mgr->SetConditions( ACTIONS::toggleCursorStyle, CHECK( cond.FullscreenCursor() ) ); + mgr->SetConditions( ACTIONS::cursorSmallCrosshairs, CHECK( cond.CursorSmallCrosshairs() ) ); + mgr->SetConditions( ACTIONS::cursorFullCrosshairs, CHECK( cond.CursorFullCrosshairs() ) ); + mgr->SetConditions( ACTIONS::cursor45Crosshairs, CHECK( cond.Cursor45Crosshairs() ) ); mgr->SetConditions( ACTIONS::millimetersUnits, CHECK( cond.Units( EDA_UNITS::MM ) ) ); mgr->SetConditions( ACTIONS::inchesUnits, CHECK( cond.Units( EDA_UNITS::INCH ) ) ); mgr->SetConditions( ACTIONS::milsUnits, CHECK( cond.Units( EDA_UNITS::MILS ) ) ); diff --git a/eeschema/symbol_editor/symbol_edit_frame.cpp b/eeschema/symbol_editor/symbol_edit_frame.cpp index 8e7aaa14b2..5d988cb685 100644 --- a/eeschema/symbol_editor/symbol_edit_frame.cpp +++ b/eeschema/symbol_editor/symbol_edit_frame.cpp @@ -488,7 +488,9 @@ void SYMBOL_EDIT_FRAME::setupUIConditions() mgr->SetConditions( ACTIONS::toggleGrid, CHECK( cond.GridVisible() ) ); mgr->SetConditions( ACTIONS::toggleGridOverrides, CHECK( cond.GridOverrides() ) ); - mgr->SetConditions( ACTIONS::toggleCursorStyle, CHECK( cond.FullscreenCursor() ) ); + mgr->SetConditions( ACTIONS::cursorSmallCrosshairs, CHECK( cond.CursorSmallCrosshairs() ) ); + mgr->SetConditions( ACTIONS::cursorFullCrosshairs, CHECK( cond.CursorFullCrosshairs() ) ); + mgr->SetConditions( ACTIONS::cursor45Crosshairs, CHECK( cond.Cursor45Crosshairs() ) ); mgr->SetConditions( ACTIONS::millimetersUnits, CHECK( cond.Units( EDA_UNITS::MM ) ) ); mgr->SetConditions( ACTIONS::inchesUnits, CHECK( cond.Units( EDA_UNITS::INCH ) ) ); mgr->SetConditions( ACTIONS::milsUnits, CHECK( cond.Units( EDA_UNITS::MILS ) ) ); diff --git a/eeschema/symbol_editor/toolbars_symbol_editor.cpp b/eeschema/symbol_editor/toolbars_symbol_editor.cpp index 6229a566a6..e4e4cc07ad 100644 --- a/eeschema/symbol_editor/toolbars_symbol_editor.cpp +++ b/eeschema/symbol_editor/toolbars_symbol_editor.cpp @@ -62,7 +62,10 @@ std::optional SYMBOL_EDIT_TOOLBAR_SETTINGS::DefaultToolba .AppendAction( ACTIONS::inchesUnits ) .AppendAction( ACTIONS::milsUnits ) .AppendAction( ACTIONS::millimetersUnits ) - .AppendAction( ACTIONS::toggleCursorStyle ); + .AppendGroup( TOOLBAR_GROUP_CONFIG( _( "Crosshair modes" ) ) + .AddAction( ACTIONS::cursorSmallCrosshairs ) + .AddAction( ACTIONS::cursorFullCrosshairs ) + .AddAction( ACTIONS::cursor45Crosshairs ) ); config.AppendSeparator() .AppendAction( SCH_ACTIONS::showElectricalTypes ) diff --git a/eeschema/toolbars_sch_editor.cpp b/eeschema/toolbars_sch_editor.cpp index 292ea866b9..d99c48bcbf 100644 --- a/eeschema/toolbars_sch_editor.cpp +++ b/eeschema/toolbars_sch_editor.cpp @@ -61,7 +61,10 @@ std::optional SCH_EDIT_TOOLBAR_SETTINGS::DefaultToolbarCo .AppendAction( ACTIONS::inchesUnits ) .AppendAction( ACTIONS::milsUnits ) .AppendAction( ACTIONS::millimetersUnits ) - .AppendAction( ACTIONS::toggleCursorStyle ); + .AppendGroup( TOOLBAR_GROUP_CONFIG( _( "Crosshair modes" ) ) + .AddAction( ACTIONS::cursorSmallCrosshairs ) + .AddAction( ACTIONS::cursorFullCrosshairs ) + .AddAction( ACTIONS::cursor45Crosshairs ) ); config.AppendSeparator() .AppendAction( SCH_ACTIONS::toggleHiddenPins ); diff --git a/gerbview/gerbview_frame.cpp b/gerbview/gerbview_frame.cpp index 6cd300512c..3184cf3e59 100644 --- a/gerbview/gerbview_frame.cpp +++ b/gerbview/gerbview_frame.cpp @@ -1103,7 +1103,9 @@ void GERBVIEW_FRAME::setupUIConditions() mgr->SetConditions( ACTIONS::toggleGrid, CHECK( cond.GridVisible() ) ); mgr->SetConditions( ACTIONS::togglePolarCoords, CHECK( cond.PolarCoordinates() ) ); - mgr->SetConditions( ACTIONS::toggleCursorStyle, CHECK( cond.FullscreenCursor() ) ); + mgr->SetConditions( ACTIONS::cursorSmallCrosshairs, CHECK( cond.CursorSmallCrosshairs() ) ); + mgr->SetConditions( ACTIONS::cursorFullCrosshairs, CHECK( cond.CursorFullCrosshairs() ) ); + mgr->SetConditions( ACTIONS::cursor45Crosshairs, CHECK( cond.Cursor45Crosshairs() ) ); mgr->SetConditions( ACTIONS::millimetersUnits, CHECK( cond.Units( EDA_UNITS::MM ) ) ); mgr->SetConditions( ACTIONS::inchesUnits, CHECK( cond.Units( EDA_UNITS::INCH ) ) ); diff --git a/gerbview/toolbars_gerber.cpp b/gerbview/toolbars_gerber.cpp index 86f4ca9470..1b59d506a5 100644 --- a/gerbview/toolbars_gerber.cpp +++ b/gerbview/toolbars_gerber.cpp @@ -58,7 +58,10 @@ std::optional GERBVIEW_TOOLBAR_SETTINGS::DefaultToolbarCo .AppendAction( ACTIONS::inchesUnits ) .AppendAction( ACTIONS::milsUnits ) .AppendAction( ACTIONS::millimetersUnits ) - .AppendAction( ACTIONS::toggleCursorStyle ); + .AppendGroup( TOOLBAR_GROUP_CONFIG( _( "Crosshair modes" ) ) + .AddAction( ACTIONS::cursorSmallCrosshairs ) + .AddAction( ACTIONS::cursorFullCrosshairs ) + .AddAction( ACTIONS::cursor45Crosshairs ) ); config.AppendSeparator() .AppendAction( GERBVIEW_ACTIONS::flashedDisplayOutlines ) diff --git a/include/bitmaps/bitmaps_list.h b/include/bitmaps/bitmaps_list.h index 7e99650fb6..1f96667b03 100644 --- a/include/bitmaps/bitmaps_list.h +++ b/include/bitmaps/bitmaps_list.h @@ -143,6 +143,8 @@ enum class BITMAPS : unsigned int cpw, cpw_back, cursor, + cursor_fullscreen, + cursor_fullscreen45, cursor_shape, curved_ratsnest, custom_pad_to_primitives, diff --git a/include/gal/gal_display_options.h b/include/gal/gal_display_options.h index 208792548e..602d0d9ee9 100644 --- a/include/gal/gal_display_options.h +++ b/include/gal/gal_display_options.h @@ -64,6 +64,13 @@ namespace KIGFX NEVER }; + enum class CROSS_HAIR_MODE : int + { + SMALL_CROSS, + FULLSCREEN_CROSS, + FULLSCREEN_DIAGONAL + }; + class GAL_DISPLAY_OPTIONS; class GAL_API GAL_DISPLAY_OPTIONS_OBSERVER @@ -101,8 +108,8 @@ namespace KIGFX ///< Whether or not to draw the coordinate system axes bool m_axesEnabled; - ///< Fullscreen crosshair or small cross - bool m_fullscreenCursor; + ///< Crosshair drawing mode + CROSS_HAIR_MODE m_crossHairMode; ///< Force cursor display bool m_forceDisplayCursor; @@ -110,6 +117,10 @@ namespace KIGFX ///< The pixel scale factor (>1 for hi-DPI scaled displays) double m_scaleFactor; + void SetCursorMode( CROSS_HAIR_MODE aMode ) { m_crossHairMode = aMode; } + + CROSS_HAIR_MODE GetCursorMode() const { return m_crossHairMode; } + void NotifyChanged(); }; diff --git a/include/gal/graphics_abstraction_layer.h b/include/gal/graphics_abstraction_layer.h index 21f112701b..92e8ee609b 100644 --- a/include/gal/graphics_abstraction_layer.h +++ b/include/gal/graphics_abstraction_layer.h @@ -1113,7 +1113,7 @@ protected: bool m_isCursorEnabled; ///< Is the cursor enabled? bool m_forceDisplayCursor; ///< Always show cursor COLOR4D m_cursorColor; ///< Cursor color - bool m_fullscreenCursor; ///< Shape of the cursor (fullscreen or small cross) + KIGFX::CROSS_HAIR_MODE m_crossHairMode; ///< Crosshair drawing mode VECTOR2D m_cursorPosition; ///< Current cursor position (world coordinates) KICURSOR m_currentNativeCursor; ///< Current cursor diff --git a/include/settings/app_settings.h b/include/settings/app_settings.h index 26699befb8..cab282471b 100644 --- a/include/settings/app_settings.h +++ b/include/settings/app_settings.h @@ -36,13 +36,18 @@ struct KICOMMON_API CROSS_PROBING_SETTINGS bool auto_highlight; ///< Automatically turn on highlight mode in the target frame. }; +namespace KIGFX +{ + enum class CROSS_HAIR_MODE : int; +} + /** * Common cursor settings, available to every frame. */ struct KICOMMON_API CURSOR_SETTINGS { bool always_show_cursor; - bool fullscreen_cursor; + KIGFX::CROSS_HAIR_MODE cross_hair_mode; }; /** diff --git a/include/settings/json_settings.h b/include/settings/json_settings.h index caa638ad11..84be921d6f 100644 --- a/include/settings/json_settings.h +++ b/include/settings/json_settings.h @@ -22,6 +22,7 @@ #define _JSON_SETTINGS_H #include +#include #include #include @@ -388,5 +389,6 @@ extern template std::optional JSON_SETTINGS::Get( const std::s extern template std::optional JSON_SETTINGS::Get( const std::string& aPath ) const; extern template std::optional JSON_SETTINGS::Get( const std::string& aPath ) const; extern template std::optional JSON_SETTINGS::Get( const std::string& aPath ) const; +extern template std::optional JSON_SETTINGS::Get( const std::string& aPath ) const; #endif diff --git a/include/tool/actions.h b/include/tool/actions.h index 24a6921c44..2fd930bebb 100644 --- a/include/tool/actions.h +++ b/include/tool/actions.h @@ -148,7 +148,9 @@ public: static TOOL_ACTION centerContents; static TOOL_ACTION centerSelection; static TOOL_ACTION toggleCursor; - static TOOL_ACTION toggleCursorStyle; + static TOOL_ACTION cursorSmallCrosshairs; + static TOOL_ACTION cursorFullCrosshairs; + static TOOL_ACTION cursor45Crosshairs; static TOOL_ACTION highContrastMode; static TOOL_ACTION highContrastModeCycle; static TOOL_ACTION toggleBoundingBoxes; diff --git a/include/tool/common_tools.h b/include/tool/common_tools.h index 4c6f519d18..4ffe2b083e 100644 --- a/include/tool/common_tools.h +++ b/include/tool/common_tools.h @@ -64,7 +64,9 @@ public: // Cursor control int CursorControl( const TOOL_EVENT& aEvent ); int ToggleCursor( const TOOL_EVENT& aEvent ); - int ToggleCursorStyle( const TOOL_EVENT& aEvent ); + int CursorSmallCrosshairs( const TOOL_EVENT& aEvent ); + int CursorFullCrosshairs( const TOOL_EVENT& aEvent ); + int Cursor45Crosshairs( const TOOL_EVENT& aEvent ); int ToggleBoundingBoxes( const TOOL_EVENT& aEvent ); diff --git a/include/tool/editor_conditions.h b/include/tool/editor_conditions.h index e06a4ac8e7..746c716030 100644 --- a/include/tool/editor_conditions.h +++ b/include/tool/editor_conditions.h @@ -34,6 +34,11 @@ class EDA_BASE_FRAME; class EDA_DRAW_FRAME; class TOOL_ACTION; +namespace KIGFX +{ + enum class CROSS_HAIR_MODE; +} + /** * Class that groups generic conditions for editor states. */ @@ -125,7 +130,9 @@ public: * * @return Functor testing if the cursor is full screen */ - SELECTION_CONDITION FullscreenCursor(); + SELECTION_CONDITION CursorSmallCrosshairs(); + SELECTION_CONDITION CursorFullCrosshairs(); + SELECTION_CONDITION Cursor45Crosshairs(); SELECTION_CONDITION BoundingBoxes(); @@ -168,7 +175,8 @@ protected: static bool polarCoordFunc( const SELECTION& aSelection, EDA_DRAW_FRAME* aFrame ); /// Helper function used by FullscreenCursor(). - static bool cursorFunc( const SELECTION& aSelection, EDA_DRAW_FRAME* aFrame ); + static bool cursorFunc( const SELECTION& aSelection, EDA_DRAW_FRAME* aFrame, + KIGFX::CROSS_HAIR_MODE aMode ); /// Helper function used by DrawBoundingBoxes(). static bool bboxesFunc( const SELECTION& aSelection, EDA_DRAW_FRAME* aFrame ); diff --git a/pagelayout_editor/pl_editor_frame.cpp b/pagelayout_editor/pl_editor_frame.cpp index 1cc1578b3b..0e4ea80f68 100644 --- a/pagelayout_editor/pl_editor_frame.cpp +++ b/pagelayout_editor/pl_editor_frame.cpp @@ -313,7 +313,9 @@ void PL_EDITOR_FRAME::setupUIConditions() mgr->SetConditions( ACTIONS::redo, ENABLE( cond.RedoAvailable() ) ); mgr->SetConditions( ACTIONS::toggleGrid, CHECK( cond.GridVisible() ) ); - mgr->SetConditions( ACTIONS::toggleCursorStyle, CHECK( cond.FullscreenCursor() ) ); + mgr->SetConditions( ACTIONS::cursorSmallCrosshairs, CHECK( cond.CursorSmallCrosshairs() ) ); + mgr->SetConditions( ACTIONS::cursorFullCrosshairs, CHECK( cond.CursorFullCrosshairs() ) ); + mgr->SetConditions( ACTIONS::cursor45Crosshairs, CHECK( cond.Cursor45Crosshairs() ) ); mgr->SetConditions( ACTIONS::millimetersUnits, CHECK( cond.Units( EDA_UNITS::MM ) ) ); mgr->SetConditions( ACTIONS::inchesUnits, CHECK( cond.Units( EDA_UNITS::INCH ) ) ); mgr->SetConditions( ACTIONS::milsUnits, CHECK( cond.Units( EDA_UNITS::MILS ) ) ); diff --git a/pcbnew/footprint_chooser_frame.cpp b/pcbnew/footprint_chooser_frame.cpp index c1a8cb2f95..36108ffdf9 100644 --- a/pcbnew/footprint_chooser_frame.cpp +++ b/pcbnew/footprint_chooser_frame.cpp @@ -846,7 +846,9 @@ void FOOTPRINT_CHOOSER_FRAME::setupUIConditions() #define CHECK( x ) ACTION_CONDITIONS().Check( x ) mgr->SetConditions( ACTIONS::toggleGrid, CHECK( cond.GridVisible() ) ); - mgr->SetConditions( ACTIONS::toggleCursorStyle, CHECK( cond.FullscreenCursor() ) ); + mgr->SetConditions( ACTIONS::cursorSmallCrosshairs, CHECK( cond.CursorSmallCrosshairs() ) ); + mgr->SetConditions( ACTIONS::cursorFullCrosshairs, CHECK( cond.CursorFullCrosshairs() ) ); + mgr->SetConditions( ACTIONS::cursor45Crosshairs, CHECK( cond.Cursor45Crosshairs() ) ); mgr->SetConditions( ACTIONS::millimetersUnits, CHECK( cond.Units( EDA_UNITS::MM ) ) ); mgr->SetConditions( ACTIONS::inchesUnits, CHECK( cond.Units( EDA_UNITS::INCH ) ) ); diff --git a/pcbnew/footprint_edit_frame.cpp b/pcbnew/footprint_edit_frame.cpp index e76c7fdf76..d29ec83c39 100644 --- a/pcbnew/footprint_edit_frame.cpp +++ b/pcbnew/footprint_edit_frame.cpp @@ -1340,7 +1340,9 @@ void FOOTPRINT_EDIT_FRAME::setupUIConditions() mgr->SetConditions( ACTIONS::toggleGrid, CHECK( cond.GridVisible() ) ); mgr->SetConditions( ACTIONS::toggleGridOverrides, CHECK( cond.GridOverrides() ) ); - mgr->SetConditions( ACTIONS::toggleCursorStyle, CHECK( cond.FullscreenCursor() ) ); + mgr->SetConditions( ACTIONS::cursorSmallCrosshairs, CHECK( cond.CursorSmallCrosshairs() ) ); + mgr->SetConditions( ACTIONS::cursorFullCrosshairs, CHECK( cond.CursorFullCrosshairs() ) ); + mgr->SetConditions( ACTIONS::cursor45Crosshairs, CHECK( cond.Cursor45Crosshairs() ) ); mgr->SetConditions( ACTIONS::millimetersUnits, CHECK( cond.Units( EDA_UNITS::MM ) ) ); mgr->SetConditions( ACTIONS::inchesUnits, CHECK( cond.Units( EDA_UNITS::INCH ) ) ); mgr->SetConditions( ACTIONS::milsUnits, CHECK( cond.Units( EDA_UNITS::MILS ) ) ); diff --git a/pcbnew/footprint_viewer_frame.cpp b/pcbnew/footprint_viewer_frame.cpp index e89f424c20..6fd41013c2 100644 --- a/pcbnew/footprint_viewer_frame.cpp +++ b/pcbnew/footprint_viewer_frame.cpp @@ -349,7 +349,9 @@ void FOOTPRINT_VIEWER_FRAME::setupUIConditions() #define CHECK( x ) ACTION_CONDITIONS().Check( x ) mgr->SetConditions( ACTIONS::toggleGrid, CHECK( cond.GridVisible() ) ); - mgr->SetConditions( ACTIONS::toggleCursorStyle, CHECK( cond.FullscreenCursor() ) ); + mgr->SetConditions( ACTIONS::cursorSmallCrosshairs, CHECK( cond.CursorSmallCrosshairs() ) ); + mgr->SetConditions( ACTIONS::cursorFullCrosshairs, CHECK( cond.CursorFullCrosshairs() ) ); + mgr->SetConditions( ACTIONS::cursor45Crosshairs, CHECK( cond.Cursor45Crosshairs() ) ); mgr->SetConditions( ACTIONS::millimetersUnits, CHECK( cond.Units( EDA_UNITS::MM ) ) ); mgr->SetConditions( ACTIONS::inchesUnits, CHECK( cond.Units( EDA_UNITS::INCH ) ) ); mgr->SetConditions( ACTIONS::milsUnits, CHECK( cond.Units( EDA_UNITS::MILS ) ) ); diff --git a/pcbnew/footprint_wizard_frame.cpp b/pcbnew/footprint_wizard_frame.cpp index 79e12b80b3..9eb02291b4 100644 --- a/pcbnew/footprint_wizard_frame.cpp +++ b/pcbnew/footprint_wizard_frame.cpp @@ -28,6 +28,7 @@ #include #include #include <3d_viewer/eda_3d_viewer_frame.h> +#include #include #include #include @@ -197,7 +198,7 @@ FOOTPRINT_WIZARD_FRAME::FOOTPRINT_WIZARD_FRAME( KIWAY* aKiway, wxWindow* aParent m_auimgr.AddPane( GetCanvas(), wxAuiPaneInfo().Name( "DrawFrame" ).CentrePane() ); auto& galOpts = GetGalDisplayOptions(); - galOpts.m_fullscreenCursor = true; + galOpts.SetCursorMode( KIGFX::CROSS_HAIR_MODE::FULLSCREEN_CROSS ); galOpts.m_forceDisplayCursor = true; galOpts.m_axesEnabled = true; diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index 72c0a6ca16..91a4c1d778 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -823,7 +823,9 @@ void PCB_EDIT_FRAME::setupUIConditions() mgr->SetConditions( ACTIONS::toggleGrid, CHECK( cond.GridVisible() ) ); mgr->SetConditions( ACTIONS::toggleGridOverrides, CHECK( cond.GridOverrides() ) ); - mgr->SetConditions( ACTIONS::toggleCursorStyle, CHECK( cond.FullscreenCursor() ) ); + mgr->SetConditions( ACTIONS::cursorSmallCrosshairs, CHECK( cond.CursorSmallCrosshairs() ) ); + mgr->SetConditions( ACTIONS::cursorFullCrosshairs, CHECK( cond.CursorFullCrosshairs() ) ); + mgr->SetConditions( ACTIONS::cursor45Crosshairs, CHECK( cond.Cursor45Crosshairs() ) ); mgr->SetConditions( ACTIONS::togglePolarCoords, CHECK( cond.PolarCoordinates() ) ); mgr->SetConditions( ACTIONS::millimetersUnits, CHECK( cond.Units( EDA_UNITS::MM ) ) ); mgr->SetConditions( ACTIONS::inchesUnits, CHECK( cond.Units( EDA_UNITS::INCH ) ) ); diff --git a/pcbnew/toolbars_footprint_editor.cpp b/pcbnew/toolbars_footprint_editor.cpp index c170c80977..5289bd65e6 100644 --- a/pcbnew/toolbars_footprint_editor.cpp +++ b/pcbnew/toolbars_footprint_editor.cpp @@ -54,7 +54,10 @@ std::optional FOOTPRINT_EDIT_TOOLBAR_SETTINGS::DefaultToo .AppendAction( ACTIONS::inchesUnits ) .AppendAction( ACTIONS::milsUnits ) .AppendAction( ACTIONS::millimetersUnits ) - .AppendAction( ACTIONS::toggleCursorStyle ); + .AppendGroup( TOOLBAR_GROUP_CONFIG( _( "Crosshair modes" ) ) + .AddAction( ACTIONS::cursorSmallCrosshairs ) + .AddAction( ACTIONS::cursorFullCrosshairs ) + .AddAction( ACTIONS::cursor45Crosshairs ) ); config.AppendSeparator() .AppendAction( PCB_ACTIONS::toggleHV45Mode ); diff --git a/pcbnew/toolbars_footprint_viewer.cpp b/pcbnew/toolbars_footprint_viewer.cpp index ab4ee09e53..fcfee2df8a 100644 --- a/pcbnew/toolbars_footprint_viewer.cpp +++ b/pcbnew/toolbars_footprint_viewer.cpp @@ -80,7 +80,10 @@ std::optional FOOTPRINT_VIEWER_TOOLBAR_SETTINGS::DefaultT .AppendAction( ACTIONS::inchesUnits ) .AppendAction( ACTIONS::milsUnits ) .AppendAction( ACTIONS::millimetersUnits ) - .AppendAction( ACTIONS::toggleCursorStyle ); + .AppendGroup( TOOLBAR_GROUP_CONFIG( _( "Crosshair modes" ) ) + .AddAction( ACTIONS::cursorSmallCrosshairs ) + .AddAction( ACTIONS::cursorFullCrosshairs ) + .AddAction( ACTIONS::cursor45Crosshairs ) ); config.AppendSeparator() .AppendAction( PCB_ACTIONS::showPadNumbers ) diff --git a/pcbnew/toolbars_pcb_editor.cpp b/pcbnew/toolbars_pcb_editor.cpp index b108d14fb7..8eb35561b3 100644 --- a/pcbnew/toolbars_pcb_editor.cpp +++ b/pcbnew/toolbars_pcb_editor.cpp @@ -140,7 +140,10 @@ std::optional PCB_EDIT_TOOLBAR_SETTINGS::DefaultToolbarCo .AppendAction( ACTIONS::inchesUnits ) .AppendAction( ACTIONS::milsUnits ) .AppendAction( ACTIONS::millimetersUnits ) - .AppendAction( ACTIONS::toggleCursorStyle ); + .AppendGroup( TOOLBAR_GROUP_CONFIG( _( "Crosshair modes" ) ) + .AddAction( ACTIONS::cursorSmallCrosshairs ) + .AddAction( ACTIONS::cursorFullCrosshairs ) + .AddAction( ACTIONS::cursor45Crosshairs ) ); config.AppendSeparator() .AppendAction( PCB_ACTIONS::toggleHV45Mode ); diff --git a/pcbnew/tools/footprint_chooser_selection_tool.cpp b/pcbnew/tools/footprint_chooser_selection_tool.cpp index 7bc5d031a2..fd8a285a31 100644 --- a/pcbnew/tools/footprint_chooser_selection_tool.cpp +++ b/pcbnew/tools/footprint_chooser_selection_tool.cpp @@ -38,7 +38,9 @@ bool FOOTPRINT_CHOOSER_SELECTION_TOOL::Init() menu.AddSeparator( 1 ); menu.AddCheckItem( ACTIONS::toggleGrid, SELECTION_CONDITIONS::ShowAlways, 1 ); - menu.AddCheckItem( ACTIONS::toggleCursorStyle, SELECTION_CONDITIONS::ShowAlways, 1 ); + menu.AddCheckItem( ACTIONS::cursorSmallCrosshairs, SELECTION_CONDITIONS::ShowAlways, 1 ); + menu.AddCheckItem( ACTIONS::cursorFullCrosshairs, SELECTION_CONDITIONS::ShowAlways, 1 ); + menu.AddCheckItem( ACTIONS::cursor45Crosshairs, SELECTION_CONDITIONS::ShowAlways, 1 ); menu.AddSeparator( 10 ); menu.AddCheckItem( ACTIONS::inchesUnits, SELECTION_CONDITIONS::ShowAlways, 10 ); diff --git a/qa/data/config/9.99/3d_viewer.json b/qa/data/config/9.99/3d_viewer.json index 7a8a1eb11f..3fa8d45a6a 100644 --- a/qa/data/config/9.99/3d_viewer.json +++ b/qa/data/config/9.99/3d_viewer.json @@ -227,7 +227,7 @@ "window": { "cursor": { "always_show_cursor": true, - "fullscreen_cursor": false + "cross_hair_mode": 0 }, "display": 0, "grid": { diff --git a/qa/data/config/9.99/cvpcb.json b/qa/data/config/9.99/cvpcb.json index b9229b0862..138197bf35 100644 --- a/qa/data/config/9.99/cvpcb.json +++ b/qa/data/config/9.99/cvpcb.json @@ -40,7 +40,7 @@ "autozoom": true, "cursor": { "always_show_cursor": true, - "fullscreen_cursor": false + "cross_hair_mode": 0 }, "display": 0, "grid": { @@ -257,7 +257,7 @@ "window": { "cursor": { "always_show_cursor": true, - "fullscreen_cursor": false + "cross_hair_mode": 0 }, "display": 0, "grid": { diff --git a/qa/data/config/9.99/eeschema.json b/qa/data/config/9.99/eeschema.json index bfd62f2e08..705e147e85 100644 --- a/qa/data/config/9.99/eeschema.json +++ b/qa/data/config/9.99/eeschema.json @@ -202,7 +202,7 @@ "window": { "cursor": { "always_show_cursor": true, - "fullscreen_cursor": false + "cross_hair_mode": 0 }, "display": 0, "grid": { @@ -362,7 +362,7 @@ "window": { "cursor": { "always_show_cursor": true, - "fullscreen_cursor": false + "cross_hair_mode": 0 }, "display": 0, "grid": { @@ -466,7 +466,7 @@ "window": { "cursor": { "always_show_cursor": true, - "fullscreen_cursor": false + "cross_hair_mode": 0 }, "display": 0, "grid": { diff --git a/qa/data/config/9.99/fpedit.json b/qa/data/config/9.99/fpedit.json index 236d2bfc64..9bd5ac6e41 100644 --- a/qa/data/config/9.99/fpedit.json +++ b/qa/data/config/9.99/fpedit.json @@ -171,7 +171,7 @@ "window": { "cursor": { "always_show_cursor": true, - "fullscreen_cursor": false + "cross_hair_mode": 0 }, "display": 0, "footprint_text_shown_columns": "0 1 2 3 4 5 7", diff --git a/qa/data/config/9.99/kicad.json b/qa/data/config/9.99/kicad.json index e99cf25ac4..968ab4dea1 100644 --- a/qa/data/config/9.99/kicad.json +++ b/qa/data/config/9.99/kicad.json @@ -107,7 +107,7 @@ "window": { "cursor": { "always_show_cursor": true, - "fullscreen_cursor": false + "cross_hair_mode": 0 }, "display": 0, "grid": { diff --git a/qa/data/config/9.99/pcbnew.json b/qa/data/config/9.99/pcbnew.json index 3cd04968e9..03074a2565 100644 --- a/qa/data/config/9.99/pcbnew.json +++ b/qa/data/config/9.99/pcbnew.json @@ -153,7 +153,7 @@ "autozoom": true, "cursor": { "always_show_cursor": true, - "fullscreen_cursor": false + "cross_hair_mode": 0 }, "display": 0, "fp_list_width": 300, @@ -326,7 +326,7 @@ "footprint_wizard": { "cursor": { "always_show_cursor": true, - "fullscreen_cursor": false + "cross_hair_mode": 0 }, "display": 0, "grid": { @@ -635,7 +635,7 @@ "window": { "cursor": { "always_show_cursor": true, - "fullscreen_cursor": false + "cross_hair_mode": 0 }, "display": 0, "footprint_text_shown_columns": "0 1 2 3 4 5 7", diff --git a/qa/data/config/9.99/symbol_editor.json b/qa/data/config/9.99/symbol_editor.json index 3778b2e628..8736037037 100644 --- a/qa/data/config/9.99/symbol_editor.json +++ b/qa/data/config/9.99/symbol_editor.json @@ -124,7 +124,7 @@ "window": { "cursor": { "always_show_cursor": true, - "fullscreen_cursor": false + "cross_hair_mode": 0 }, "display": 0, "grid": { diff --git a/resources/bitmaps_png/CMakeLists.txt b/resources/bitmaps_png/CMakeLists.txt index 96205a90a8..8d7492c00d 100644 --- a/resources/bitmaps_png/CMakeLists.txt +++ b/resources/bitmaps_png/CMakeLists.txt @@ -239,6 +239,8 @@ set( BMAPS_MID convert copy copy_pad_settings + cursor_fullscreen + cursor_fullscreen45 cursor_shape cursor custom_pad_to_primitives diff --git a/resources/bitmaps_png/png/cursor_fullscreen45_16.png b/resources/bitmaps_png/png/cursor_fullscreen45_16.png new file mode 100644 index 0000000000..1a5623d681 Binary files /dev/null and b/resources/bitmaps_png/png/cursor_fullscreen45_16.png differ diff --git a/resources/bitmaps_png/png/cursor_fullscreen45_24.png b/resources/bitmaps_png/png/cursor_fullscreen45_24.png new file mode 100644 index 0000000000..543780238d Binary files /dev/null and b/resources/bitmaps_png/png/cursor_fullscreen45_24.png differ diff --git a/resources/bitmaps_png/png/cursor_fullscreen45_32.png b/resources/bitmaps_png/png/cursor_fullscreen45_32.png new file mode 100644 index 0000000000..4ff4b22307 Binary files /dev/null and b/resources/bitmaps_png/png/cursor_fullscreen45_32.png differ diff --git a/resources/bitmaps_png/png/cursor_fullscreen45_48.png b/resources/bitmaps_png/png/cursor_fullscreen45_48.png new file mode 100644 index 0000000000..6a90d92e40 Binary files /dev/null and b/resources/bitmaps_png/png/cursor_fullscreen45_48.png differ diff --git a/resources/bitmaps_png/png/cursor_fullscreen45_64.png b/resources/bitmaps_png/png/cursor_fullscreen45_64.png new file mode 100644 index 0000000000..f334db3fca Binary files /dev/null and b/resources/bitmaps_png/png/cursor_fullscreen45_64.png differ diff --git a/resources/bitmaps_png/png/cursor_fullscreen45_dark_16.png b/resources/bitmaps_png/png/cursor_fullscreen45_dark_16.png new file mode 100644 index 0000000000..3422b54e04 Binary files /dev/null and b/resources/bitmaps_png/png/cursor_fullscreen45_dark_16.png differ diff --git a/resources/bitmaps_png/png/cursor_fullscreen45_dark_24.png b/resources/bitmaps_png/png/cursor_fullscreen45_dark_24.png new file mode 100644 index 0000000000..2d25d36291 Binary files /dev/null and b/resources/bitmaps_png/png/cursor_fullscreen45_dark_24.png differ diff --git a/resources/bitmaps_png/png/cursor_fullscreen45_dark_32.png b/resources/bitmaps_png/png/cursor_fullscreen45_dark_32.png new file mode 100644 index 0000000000..f60435466c Binary files /dev/null and b/resources/bitmaps_png/png/cursor_fullscreen45_dark_32.png differ diff --git a/resources/bitmaps_png/png/cursor_fullscreen45_dark_48.png b/resources/bitmaps_png/png/cursor_fullscreen45_dark_48.png new file mode 100644 index 0000000000..36569cf895 Binary files /dev/null and b/resources/bitmaps_png/png/cursor_fullscreen45_dark_48.png differ diff --git a/resources/bitmaps_png/png/cursor_fullscreen45_dark_64.png b/resources/bitmaps_png/png/cursor_fullscreen45_dark_64.png new file mode 100644 index 0000000000..e0037b054c Binary files /dev/null and b/resources/bitmaps_png/png/cursor_fullscreen45_dark_64.png differ diff --git a/resources/bitmaps_png/png/cursor_fullscreen_16.png b/resources/bitmaps_png/png/cursor_fullscreen_16.png new file mode 100644 index 0000000000..1027fc9245 Binary files /dev/null and b/resources/bitmaps_png/png/cursor_fullscreen_16.png differ diff --git a/resources/bitmaps_png/png/cursor_fullscreen_24.png b/resources/bitmaps_png/png/cursor_fullscreen_24.png new file mode 100644 index 0000000000..22d9f58607 Binary files /dev/null and b/resources/bitmaps_png/png/cursor_fullscreen_24.png differ diff --git a/resources/bitmaps_png/png/cursor_fullscreen_32.png b/resources/bitmaps_png/png/cursor_fullscreen_32.png new file mode 100644 index 0000000000..a2bc47fe4e Binary files /dev/null and b/resources/bitmaps_png/png/cursor_fullscreen_32.png differ diff --git a/resources/bitmaps_png/png/cursor_fullscreen_48.png b/resources/bitmaps_png/png/cursor_fullscreen_48.png new file mode 100644 index 0000000000..3e696a06fc Binary files /dev/null and b/resources/bitmaps_png/png/cursor_fullscreen_48.png differ diff --git a/resources/bitmaps_png/png/cursor_fullscreen_64.png b/resources/bitmaps_png/png/cursor_fullscreen_64.png new file mode 100644 index 0000000000..98267ec9b9 Binary files /dev/null and b/resources/bitmaps_png/png/cursor_fullscreen_64.png differ diff --git a/resources/bitmaps_png/png/cursor_fullscreen_dark_16.png b/resources/bitmaps_png/png/cursor_fullscreen_dark_16.png new file mode 100644 index 0000000000..edc4be19ff Binary files /dev/null and b/resources/bitmaps_png/png/cursor_fullscreen_dark_16.png differ diff --git a/resources/bitmaps_png/png/cursor_fullscreen_dark_24.png b/resources/bitmaps_png/png/cursor_fullscreen_dark_24.png new file mode 100644 index 0000000000..cef61c2433 Binary files /dev/null and b/resources/bitmaps_png/png/cursor_fullscreen_dark_24.png differ diff --git a/resources/bitmaps_png/png/cursor_fullscreen_dark_32.png b/resources/bitmaps_png/png/cursor_fullscreen_dark_32.png new file mode 100644 index 0000000000..5df8c6bd5b Binary files /dev/null and b/resources/bitmaps_png/png/cursor_fullscreen_dark_32.png differ diff --git a/resources/bitmaps_png/png/cursor_fullscreen_dark_48.png b/resources/bitmaps_png/png/cursor_fullscreen_dark_48.png new file mode 100644 index 0000000000..b2eb734ada Binary files /dev/null and b/resources/bitmaps_png/png/cursor_fullscreen_dark_48.png differ diff --git a/resources/bitmaps_png/png/cursor_fullscreen_dark_64.png b/resources/bitmaps_png/png/cursor_fullscreen_dark_64.png new file mode 100644 index 0000000000..e9eb36119d Binary files /dev/null and b/resources/bitmaps_png/png/cursor_fullscreen_dark_64.png differ diff --git a/resources/bitmaps_png/png/cursor_shape_16.png b/resources/bitmaps_png/png/cursor_shape_16.png index 1ae0d504b5..95206b80d8 100644 Binary files a/resources/bitmaps_png/png/cursor_shape_16.png and b/resources/bitmaps_png/png/cursor_shape_16.png differ diff --git a/resources/bitmaps_png/png/cursor_shape_24.png b/resources/bitmaps_png/png/cursor_shape_24.png index e57c38e1a0..d177ab28d4 100644 Binary files a/resources/bitmaps_png/png/cursor_shape_24.png and b/resources/bitmaps_png/png/cursor_shape_24.png differ diff --git a/resources/bitmaps_png/png/cursor_shape_32.png b/resources/bitmaps_png/png/cursor_shape_32.png index 9f142f53fc..2b7ef5a071 100644 Binary files a/resources/bitmaps_png/png/cursor_shape_32.png and b/resources/bitmaps_png/png/cursor_shape_32.png differ diff --git a/resources/bitmaps_png/png/cursor_shape_48.png b/resources/bitmaps_png/png/cursor_shape_48.png index dec8d9d7b9..73039d8d22 100644 Binary files a/resources/bitmaps_png/png/cursor_shape_48.png and b/resources/bitmaps_png/png/cursor_shape_48.png differ diff --git a/resources/bitmaps_png/png/cursor_shape_64.png b/resources/bitmaps_png/png/cursor_shape_64.png index c3dbfefba0..234e37dc9f 100644 Binary files a/resources/bitmaps_png/png/cursor_shape_64.png and b/resources/bitmaps_png/png/cursor_shape_64.png differ diff --git a/resources/bitmaps_png/png/cursor_shape_dark_16.png b/resources/bitmaps_png/png/cursor_shape_dark_16.png index 30561dd3fd..faa519852d 100644 Binary files a/resources/bitmaps_png/png/cursor_shape_dark_16.png and b/resources/bitmaps_png/png/cursor_shape_dark_16.png differ diff --git a/resources/bitmaps_png/png/cursor_shape_dark_24.png b/resources/bitmaps_png/png/cursor_shape_dark_24.png index 69993c628e..26b7489645 100644 Binary files a/resources/bitmaps_png/png/cursor_shape_dark_24.png and b/resources/bitmaps_png/png/cursor_shape_dark_24.png differ diff --git a/resources/bitmaps_png/png/cursor_shape_dark_32.png b/resources/bitmaps_png/png/cursor_shape_dark_32.png index 3e531734ed..2af7087ba6 100644 Binary files a/resources/bitmaps_png/png/cursor_shape_dark_32.png and b/resources/bitmaps_png/png/cursor_shape_dark_32.png differ diff --git a/resources/bitmaps_png/png/cursor_shape_dark_48.png b/resources/bitmaps_png/png/cursor_shape_dark_48.png index 86fad49981..f84834c707 100644 Binary files a/resources/bitmaps_png/png/cursor_shape_dark_48.png and b/resources/bitmaps_png/png/cursor_shape_dark_48.png differ diff --git a/resources/bitmaps_png/png/cursor_shape_dark_64.png b/resources/bitmaps_png/png/cursor_shape_dark_64.png index f853164b0b..ade63e5f2b 100644 Binary files a/resources/bitmaps_png/png/cursor_shape_dark_64.png and b/resources/bitmaps_png/png/cursor_shape_dark_64.png differ diff --git a/resources/bitmaps_png/sources/dark/cursor_fullscreen.svg b/resources/bitmaps_png/sources/dark/cursor_fullscreen.svg new file mode 100644 index 0000000000..58cd75af35 --- /dev/null +++ b/resources/bitmaps_png/sources/dark/cursor_fullscreen.svg @@ -0,0 +1,204 @@ + + + + + + image/svg+xml + + cursor_shape + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + cursor_shape + + + + + + + + diff --git a/resources/bitmaps_png/sources/dark/cursor_fullscreen45.svg b/resources/bitmaps_png/sources/dark/cursor_fullscreen45.svg new file mode 100644 index 0000000000..774ac201c6 --- /dev/null +++ b/resources/bitmaps_png/sources/dark/cursor_fullscreen45.svg @@ -0,0 +1,207 @@ + + + + + + image/svg+xml + + cursor_shape + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + cursor_shape + + + + + + + + diff --git a/resources/bitmaps_png/sources/dark/cursor_shape.svg b/resources/bitmaps_png/sources/dark/cursor_shape.svg index 1fa92890ce..7b3227b57a 100644 --- a/resources/bitmaps_png/sources/dark/cursor_shape.svg +++ b/resources/bitmaps_png/sources/dark/cursor_shape.svg @@ -1,22 +1,22 @@ + inkscape:export-ydpi="96" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> @@ -60,16 +60,24 @@ id="namedview2367" showgrid="true" inkscape:zoom="45.254834" - inkscape:cx="10.543725" - inkscape:cy="13.371759" + inkscape:cx="10.551359" + inkscape:cy="13.368738" inkscape:window-x="1453" inkscape:window-y="97" inkscape:window-maximized="0" - inkscape:current-layer="Слой_1" - inkscape:document-rotation="0"> + inkscape:current-layer="g1564" + inkscape:document-rotation="0" + inkscape:showpageshadow="2" + inkscape:pagecheckerboard="0" + inkscape:deskcolor="#d1d1d1"> + id="grid2947" + originx="0" + originy="0" + spacingy="1" + spacingx="1" + units="px" /> @@ -168,18 +176,7 @@ cursor_shape - - - + id="g1564" /> + + + + + image/svg+xml + + cursor_shape + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + cursor_shape + + + + + + + + diff --git a/resources/bitmaps_png/sources/light/cursor_fullscreen45.svg b/resources/bitmaps_png/sources/light/cursor_fullscreen45.svg new file mode 100644 index 0000000000..c7c9bb1622 --- /dev/null +++ b/resources/bitmaps_png/sources/light/cursor_fullscreen45.svg @@ -0,0 +1,206 @@ + + + + + + image/svg+xml + + cursor_shape + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + cursor_shape + + + + + + + + diff --git a/resources/bitmaps_png/sources/light/cursor_shape.svg b/resources/bitmaps_png/sources/light/cursor_shape.svg index 486697e651..825f8c887a 100644 --- a/resources/bitmaps_png/sources/light/cursor_shape.svg +++ b/resources/bitmaps_png/sources/light/cursor_shape.svg @@ -1,22 +1,22 @@ + inkscape:export-ydpi="96" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> @@ -60,16 +60,24 @@ id="namedview2367" showgrid="true" inkscape:zoom="45.254834" - inkscape:cx="10.543725" - inkscape:cy="13.371759" + inkscape:cx="10.551359" + inkscape:cy="13.368738" inkscape:window-x="1453" inkscape:window-y="97" inkscape:window-maximized="0" - inkscape:current-layer="Слой_1" - inkscape:document-rotation="0"> + inkscape:current-layer="g1564" + inkscape:document-rotation="0" + inkscape:showpageshadow="2" + inkscape:pagecheckerboard="0" + inkscape:deskcolor="#d1d1d1"> + id="grid2947" + originx="0" + originy="0" + spacingy="1" + spacingx="1" + units="px" /> @@ -168,18 +176,7 @@ cursor_shape - - - + id="g1564" />