From: Thomas Debesse Date: Tue, 21 Jun 2022 04:23:57 +0000 (+0200) Subject: Merge commit '8d6828cd68e9104c2c68b962b341b4f572b4bc38' into master-merge X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2dac2343d25b8a490ea93adfa8e828c88ec97595;p=xonotic%2Fnetradiant.git Merge commit '8d6828cd68e9104c2c68b962b341b4f572b4bc38' into master-merge --- 2dac2343d25b8a490ea93adfa8e828c88ec97595 diff --cc radiant/camwindow.h index 4bb85080,438af28f..d5e76f92 --- a/radiant/camwindow.h +++ b/radiant/camwindow.h @@@ -68,7 -70,8 +70,8 @@@ struct camwindow_globals_ camwindow_globals_t() : color_cameraback( 0.25f, 0.25f, 0.25f ), color_selbrushes3d( 1.0f, 0.f, 0.f ), - m_nCubicScale( 26 ){ - m_nCubicScale( 14 ), ++ m_nCubicScale( 26 ), + m_bZoomInToPointer( true ){ } }; diff --cc radiant/preferences.cpp index 8d169461,adbfefba..efff8a08 --- a/radiant/preferences.cpp +++ b/radiant/preferences.cpp @@@ -727,12 -667,9 +719,12 @@@ PreferencesPage createPage( const char ui::Window PrefsDlg::BuildDialog(){ PreferencesDialog_addInterfacePreferences( makeCallbackF(Interface_constructPreferences) ); - Mouse_registerPreferencesPage(); + //Mouse_registerPreferencesPage(); - ui::Window dialog = ui::Window(create_floating_window( "NetRadiant Preferences", m_parent )); + ui::Window dialog = ui::Window(create_floating_window( RADIANT_NAME " Preferences", m_parent )); + + gtk_window_set_transient_for( dialog, m_parent ); + gtk_window_set_position( dialog, GTK_WIN_POS_CENTER_ON_PARENT ); { auto mainvbox = ui::VBox( FALSE, 5 ); diff --cc radiant/xywindow.cpp index 381f5b07,6da0a4b2..4edf8344 --- a/radiant/xywindow.cpp +++ b/radiant/xywindow.cpp @@@ -998,12 -995,28 +1003,34 @@@ void XYWnd::Clipper_OnMouseMoved( int x void XYWnd::Clipper_Crosshair_OnMouseMoved( int x, int y ){ Vector3 mousePosition; XY_ToPoint( x, y, mousePosition ); ++#if 0 // NetRadiantCustom + if ( ClipMode() ) { + if( GlobalClipPoints_Find( mousePosition, (VIEWTYPE)m_viewType, m_fScale ) != 0 ){ + GdkCursor *cursor; + cursor = gdk_cursor_new( GDK_CROSSHAIR ); + //cursor = gdk_cursor_new( GDK_FLEUR ); + gdk_window_set_cursor( gtk_widget_get_window(m_gl_widget), cursor ); + gdk_cursor_unref( cursor ); + } + else{ + GdkCursor *cursor; + cursor = gdk_cursor_new( GDK_HAND2 ); + // GdkPixbuf* pixbuf = pixbuf_new_from_file_with_mask( "bitmaps/icon.png" ); + // cursor = gdk_cursor_new_from_pixbuf( gdk_display_get_default(), pixbuf, 0, 0 ); + // g_object_unref( pixbuf ); + gdk_window_set_cursor( gtk_widget_get_window(m_gl_widget), cursor ); + gdk_cursor_unref( cursor ); + + } + } ++#else + if ( ClipMode() && GlobalClipPoints_Find( mousePosition, (VIEWTYPE)m_viewType, m_fScale ) != 0 ) { + set_cursor ( m_gl_widget, GDK_CROSSHAIR ); + } ++#endif else { - gdk_window_set_cursor( gtk_widget_get_window(m_gl_widget), 0 ); + default_cursor( m_gl_widget ); } } @@@ -1311,7 -1322,12 +1340,12 @@@ void XYWnd_zoomDelta( int x, int y, uns } else { + if ( g_xywindow_globals.m_bZoomInToPointer ) { + reinterpret_cast( data )->ZoomInWithMouse( g_zoom2x, g_zoom2y ); + } + else{ - reinterpret_cast( data )->ZoomIn(); + reinterpret_cast( data )->ZoomIn(); + } g_dragZoom += 8; } } @@@ -1329,9 -1345,9 +1363,11 @@@ void XYWnd::Zoom_Begin( int x, int y ) } m_zoom_started = true; g_dragZoom = 0; + g_zoom2x = x; + g_zoom2y = y; - g_xywnd_freezePointer.freeze_pointer( m_parent ? m_parent : MainFrame_getWindow(), m_gl_widget, XYWnd_zoomDelta, this ); + /* NetRadiantCustom did this instead: + g_xywnd_freezePointer.freeze_pointer( m_parent ? m_parent : MainFrame_getWindow(), m_gl_widget, XYWnd_zoomDelta, this ); */ + g_xywnd_freezePointer.freeze_pointer( m_parent ? m_parent : MainFrame_getWindow(), XYWnd_zoomDelta, this ); m_zoom_focusOut = m_gl_widget.connect( "focus_out_event", G_CALLBACK( XYWnd_Zoom_focusOut ), this ); }