mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Makes the base intel window scrollable.
Contributes-to: Khopa/dcs_liberation#691
This commit is contained in:
parent
454b540bce
commit
7741713a7c
@ -4,7 +4,10 @@ from PySide2.QtWidgets import (
|
|||||||
QGroupBox,
|
QGroupBox,
|
||||||
QLabel,
|
QLabel,
|
||||||
QVBoxLayout,
|
QVBoxLayout,
|
||||||
|
QScrollArea,
|
||||||
|
QWidget,
|
||||||
)
|
)
|
||||||
|
from PySide2.QtCore import Qt
|
||||||
from dcs.task import CAP, CAS, Embarking, PinpointStrike
|
from dcs.task import CAP, CAS, Embarking, PinpointStrike
|
||||||
|
|
||||||
from game import Game, db
|
from game import Game, db
|
||||||
@ -21,10 +24,11 @@ class QIntelInfo(QFrame):
|
|||||||
|
|
||||||
def init_ui(self):
|
def init_ui(self):
|
||||||
layout = QVBoxLayout()
|
layout = QVBoxLayout()
|
||||||
|
scroll_content = QWidget()
|
||||||
intel = QGroupBox("Intel")
|
|
||||||
intelLayout = QVBoxLayout()
|
intelLayout = QVBoxLayout()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
units = {
|
units = {
|
||||||
CAP: db.find_unittype(CAP, self.game.enemy_name),
|
CAP: db.find_unittype(CAP, self.game.enemy_name),
|
||||||
Embarking: db.find_unittype(Embarking, self.game.enemy_name),
|
Embarking: db.find_unittype(Embarking, self.game.enemy_name),
|
||||||
@ -52,8 +56,13 @@ class QIntelInfo(QFrame):
|
|||||||
|
|
||||||
intelLayout.addWidget(group)
|
intelLayout.addWidget(group)
|
||||||
|
|
||||||
intelLayout.addStretch()
|
scroll_content.setLayout(intelLayout)
|
||||||
intel.setLayout(intelLayout)
|
scroll = QScrollArea()
|
||||||
layout.addWidget(intel)
|
scroll.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
|
||||||
layout.addStretch()
|
scroll.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn)
|
||||||
|
scroll.setWidgetResizable(True)
|
||||||
|
scroll.setWidget(scroll_content)
|
||||||
|
|
||||||
|
layout.addWidget(scroll)
|
||||||
|
|
||||||
self.setLayout(layout)
|
self.setLayout(layout)
|
||||||
Loading…
x
Reference in New Issue
Block a user