@@ -433,20 +433,18 @@ def __init__(self, parent=None):
433
433
placeHolderTxt = QCoreApplication .translate ("PythonConsole" , "Enter text to find..." )
434
434
435
435
self .lineEditFind .setPlaceholderText (placeHolderTxt )
436
- self .findNextButton = QToolButton ()
436
+ self .toolBarFindText = QToolBar ()
437
+ self .toolBarFindText .setIconSize (icon_size )
438
+ self .findNextButton = QAction (self )
437
439
self .findNextButton .setEnabled (False )
438
440
toolTipfindNext = QCoreApplication .translate ("PythonConsole" , "Find Next" )
439
441
self .findNextButton .setToolTip (toolTipfindNext )
440
442
self .findNextButton .setIcon (QgsApplication .getThemeIcon ("console/iconSearchNextEditorConsole.png" ))
441
- self .findNextButton .setIconSize (QSize (24 , 24 ))
442
- self .findNextButton .setAutoRaise (True )
443
- self .findPrevButton = QToolButton ()
443
+ self .findPrevButton = QAction (self )
444
444
self .findPrevButton .setEnabled (False )
445
445
toolTipfindPrev = QCoreApplication .translate ("PythonConsole" , "Find Previous" )
446
446
self .findPrevButton .setToolTip (toolTipfindPrev )
447
447
self .findPrevButton .setIcon (QgsApplication .getThemeIcon ("console/iconSearchPrevEditorConsole.png" ))
448
- self .findPrevButton .setIconSize (QSize (24 , 24 ))
449
- self .findPrevButton .setAutoRaise (True )
450
448
self .caseSensitive = QCheckBox ()
451
449
caseSensTr = QCoreApplication .translate ("PythonConsole" , "Case Sensitive" )
452
450
self .caseSensitive .setText (caseSensTr )
@@ -457,12 +455,15 @@ def __init__(self, parent=None):
457
455
self .wrapAround .setChecked (True )
458
456
wrapAroundTr = QCoreApplication .translate ("PythonConsole" , "Wrap Around" )
459
457
self .wrapAround .setText (wrapAroundTr )
460
- self .layoutFind .addWidget (self .lineEditFind , 0 , 1 , 1 , 1 )
461
- self .layoutFind .addWidget (self .findPrevButton , 0 , 2 , 1 , 1 )
462
- self .layoutFind .addWidget (self .findNextButton , 0 , 3 , 1 , 1 )
463
- self .layoutFind .addWidget (self .caseSensitive , 0 , 4 , 1 , 1 )
464
- self .layoutFind .addWidget (self .wholeWord , 0 , 5 , 1 , 1 )
465
- self .layoutFind .addWidget (self .wrapAround , 0 , 6 , 1 , 1 )
458
+
459
+ self .toolBarFindText .addWidget (self .lineEditFind )
460
+ self .toolBarFindText .addAction (self .findPrevButton )
461
+ self .toolBarFindText .addAction (self .findNextButton )
462
+ self .toolBarFindText .addWidget (self .caseSensitive )
463
+ self .toolBarFindText .addWidget (self .wholeWord )
464
+ self .toolBarFindText .addWidget (self .wrapAround )
465
+
466
+ self .layoutFind .addWidget (self .toolBarFindText , 0 , 1 , 1 , 1 )
466
467
467
468
# ------------ Add first Tab in Editor -------------------------------
468
469
@@ -489,8 +490,8 @@ def __init__(self, parent=None):
489
490
self .helpButton .triggered .connect (self .openHelp )
490
491
self .listClassMethod .itemClicked .connect (self .onClickGoToLine )
491
492
self .lineEditFind .returnPressed .connect (self ._findNext )
492
- self .findNextButton .clicked .connect (self ._findNext )
493
- self .findPrevButton .clicked .connect (self ._findPrev )
493
+ self .findNextButton .triggered .connect (self ._findNext )
494
+ self .findPrevButton .triggered .connect (self ._findPrev )
494
495
self .lineEditFind .textChanged .connect (self ._textFindChanged )
495
496
496
497
self .findScut = QShortcut (QKeySequence .Find , self .widgetEditor )
0 commit comments