Show the View menu in the correct place in the menu bar.

master
Pacman Ghost 7 years ago
parent c379e548dd
commit dd598c315e
  1. 9
      main_window.py
  2. 2
      ui/about_widget.ui

@ -2,7 +2,7 @@ import sys
import os
from PyQt5.QtCore import Qt , QPoint , QSize
from PyQt5.QtWidgets import QApplication , QMainWindow , QVBoxLayout , QHBoxLayout , QWidget , QTabWidget , QLabel
from PyQt5.QtWidgets import QApplication , QMainWindow , QVBoxLayout , QHBoxLayout , QWidget , QTabWidget , QLabel , QMenu
from PyQt5.QtWidgets import QMessageBox , QAction
from PyQt5.QtGui import QPainter , QPixmap , QIcon , QBrush
@ -74,11 +74,11 @@ class MainWindow( QMainWindow ) :
action.setStatusTip( "Close the program." )
action.triggered.connect( self.close )
file_menu.addAction( action )
help_menu = menu_bar.addMenu( "&Help" )
self.help_menu = menu_bar.addMenu( "&Help" )
about_action = QAction( "&About" , self )
about_action.setStatusTip( "About this program." )
about_action.triggered.connect( self.on_about )
help_menu.addAction( about_action )
self.help_menu.addAction( about_action )
# restore the window geometry
buf = globals.app_settings.value( MAINWINDOW_GEOMETRY )
if buf :
@ -137,7 +137,8 @@ class MainWindow( QMainWindow ) :
db.open_database( db_fname , False )
globals.cards = db.load_cards()
# show the View menu
self.view_menu = self.menuBar().addMenu( "&View" )
self.view_menu = QMenu( "&View" )
self.menuBar().insertMenu( self.help_menu.menuAction() , self.view_menu )
self.view_menu.aboutToShow.connect( self.on_about_to_show_view_menu )
# ask the user to add the first card
self.add_card_action.setEnabled( True )

@ -84,7 +84,7 @@
<widget class="QLabel" name="lbl_avatar">
<property name="geometry">
<rect>
<x>180</x>
<x>183</x>
<y>25</y>
<width>21</width>
<height>21</height>

Loading…
Cancel
Save