Browse Source

UI: Make close button default in transform dialog

Improves ease of use.

Closes jp9000/obs-studio#731
SuslikV 8 years ago
parent
commit
ee019c7761
2 changed files with 10 additions and 3 deletions
  1. 8 1
      UI/forms/OBSBasicTransform.ui
  2. 2 2
      UI/window-basic-transform.cpp

+ 8 - 1
UI/forms/OBSBasicTransform.ui

@@ -648,5 +648,12 @@
   </layout>
  </widget>
  <resources/>
- <connections/>
+ <connections>
+  <connection>
+   <sender>buttonBox</sender>
+   <signal>rejected()</signal>
+   <receiver>OBSBasicTransform</receiver>
+   <slot>reject()</slot>
+  </connection>
+ </connections>
 </ui>

+ 2 - 2
UI/window-basic-transform.cpp

@@ -56,10 +56,10 @@ OBSBasicTransform::OBSBasicTransform(OBSBasic *parent)
 	HookWidget(ui->cropTop,      ISCROLL_CHANGED, SLOT(OnCropChanged()));
 	HookWidget(ui->cropBottom,   ISCROLL_CHANGED, SLOT(OnCropChanged()));
 
+	ui->buttonBox->button(QDialogButtonBox::Close)->setDefault(true);
+
 	connect(ui->buttonBox->button(QDialogButtonBox::Reset),
 		SIGNAL(clicked()), this, SLOT(on_resetButton_clicked()));
-	connect(ui->buttonBox,
-		SIGNAL(rejected()), this, SLOT(close()));
 
 	installEventFilter(CreateShortcutFilter());