mirror of
https://github.com/TTimo/GtkRadiant.git
synced 2025-01-26 11:21:08 +00:00
commit
c66e55196b
1 changed files with 47 additions and 0 deletions
|
@ -1174,6 +1174,47 @@ static void entitylist_multiselect( GtkWidget *widget, gpointer data ) {
|
||||||
Sys_UpdateWindows( W_ALL );
|
Sys_UpdateWindows( W_ALL );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void entitylist_focus( GtkWidget *widget, gpointer data ){
|
||||||
|
GtkTreeView* view = GTK_TREE_VIEW( g_object_get_data( G_OBJECT( data ), "entities" ) );
|
||||||
|
|
||||||
|
GtkTreeSelection* selection = gtk_tree_view_get_selection( view );
|
||||||
|
|
||||||
|
GtkTreeModel* model;
|
||||||
|
GtkTreeIter selected;
|
||||||
|
if ( gtk_tree_selection_get_selected( selection, &model, &selected ) ) {
|
||||||
|
entity_t* pEntity;
|
||||||
|
gtk_tree_model_get( model, &selected, 1, &pEntity, -1 );
|
||||||
|
|
||||||
|
if ( pEntity ) {
|
||||||
|
for ( epair_t* pEpair = pEntity->epairs; pEpair; pEpair = pEpair->next )
|
||||||
|
{
|
||||||
|
brush_t *b;
|
||||||
|
|
||||||
|
b = pEntity->brushes.onext;
|
||||||
|
if( b )
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
for ( i = 0; i < 3; i++ )
|
||||||
|
{
|
||||||
|
if ( g_pParentWnd->GetXYWnd() ) {
|
||||||
|
g_pParentWnd->GetXYWnd()->GetOrigin()[i] = ( b->mins[i] + b->maxs[i] ) / 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( g_pParentWnd->GetXZWnd() ) {
|
||||||
|
g_pParentWnd->GetXZWnd()->GetOrigin()[i] = ( b->mins[i] + b->maxs[i] ) / 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( g_pParentWnd->GetYZWnd() ) {
|
||||||
|
g_pParentWnd->GetYZWnd()->GetOrigin()[i] = ( b->mins[i] + b->maxs[i] ) / 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Sys_UpdateWindows( W_ALL );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static gint entitylist_click( GtkWidget *widget, GdkEventButton *event, gpointer data ){
|
static gint entitylist_click( GtkWidget *widget, GdkEventButton *event, gpointer data ){
|
||||||
if ( event->type == GDK_2BUTTON_PRESS ) {
|
if ( event->type == GDK_2BUTTON_PRESS ) {
|
||||||
entitylist_select( NULL, data );
|
entitylist_select( NULL, data );
|
||||||
|
@ -1436,6 +1477,12 @@ void DoEntityList(){
|
||||||
gtk_widget_set_size_request( button, 60, -1 );
|
gtk_widget_set_size_request( button, 60, -1 );
|
||||||
gtk_widget_show( button );
|
gtk_widget_show( button );
|
||||||
|
|
||||||
|
button = gtk_button_new_with_label( _( "Focus 2D View" ) );
|
||||||
|
gtk_box_pack_start( GTK_BOX( hbox2 ), button, FALSE, FALSE, 0 );
|
||||||
|
g_signal_connect( G_OBJECT( button ), "clicked",
|
||||||
|
G_CALLBACK( entitylist_focus ), dialog );
|
||||||
|
gtk_widget_show( button );
|
||||||
|
|
||||||
|
|
||||||
g_signal_connect( dialog, "response", G_CALLBACK( EnitityList_response ), dialog );
|
g_signal_connect( dialog, "response", G_CALLBACK( EnitityList_response ), dialog );
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue