Skip to content

Commit

Permalink
Fix Windows build, fix header sizing
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Higerd committed Mar 1, 2024
1 parent fc0621c commit 2366511
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion agbplay-gui.pro
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ CONFIG += release
CONFIG -= debug debug_and_release
CONFIG += link_pkgconfig
!isEmpty(PA_ROOT) {
INCLUDESPATH += $$PA_ROOT/include
INCLUDEPATH += $$PA_ROOT/include
LIBS += -L$$PA_ROOT/lib -lportaudio
}
else:packagesExist(portaudio-2.0) {
Expand Down
2 changes: 1 addition & 1 deletion src/PlayerWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <QPushButton>

PlayerWindow::PlayerWindow(Player* player, QWidget* parent)
: QMainWindow(parent), player(player)
: QMainWindow(parent), player(player), playlistIsDirty(false)
{
setWindowTitle("agbplay");
songs = player->songModel();
Expand Down
14 changes: 14 additions & 0 deletions src/TrackHeader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,20 @@ TrackHeader::TrackHeader(QWidget* parent)
mute = calcRect(muteCheck, tr("Mute"));
lineHeight = mute.height();

QStyleOptionHeader opt;
opt.initFrom(this);
opt.state = QStyle::State_None | QStyle::State_Raised | QStyle::State_Horizontal | QStyle::State_Active | QStyle::State_Enabled;
opt.orientation = Qt::Horizontal;
opt.section = 1;
opt.text = "X";
opt.position = QStyleOptionHeader::Middle;
opt.rect = QRect(0, 0, 50, lineHeight);
QSize headerSize = style()->sizeFromContents(QStyle::CT_HeaderSection, &opt, opt.rect.size(), this);
if (headerSize.height() > lineHeight) {
lineHeight = headerSize.height();
mute.setHeight(lineHeight);
}

trackNumber = calcRect(QLabel("00"), tr("Track"));
solo = calcRect(QCheckBox(tr("S")), tr("Solo"));
location = calcRect(QLabel("0x01234567"), tr("Location"));
Expand Down
2 changes: 1 addition & 1 deletion src/TrackList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ TrackList::TrackList(QWidget* parent)
trackLayout = new QVBoxLayout(base);
trackLayout->setContentsMargins(0, 0, 0, 0);
header = new TrackHeader(this);
header->setTrackName("Test Track");
header->setTrackName("");

// populate a dummy entry for geometry
TrackView* v = new TrackView(header, 0, base);
Expand Down
5 changes: 4 additions & 1 deletion windows/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,15 @@ lib/libportaudio.a: portaudio/configure

Makefile.agbplay-gui: lib/libportaudio.a lib/libQt5Widgets.a ../agbplay-gui.pro
mkdir -p .build
./qtbase/bin/qmake -o Makefile.agbplay-gui .. $(CROSS_QMAKE) PA_ROOT=.
./qtbase/bin/qmake -o Makefile.agbplay-gui .. $(CROSS_QMAKE) PA_ROOT=$(CURDIR)

agbplay-gui.exe: Makefile.agbplay-gui lib/libportaudio.a lib/libQt5Widgets.a FORCE
mkdir -p .build
+$(MAKE) -f Makefile.agbplay-gui

clean:
+$(MAKE) -f Makefile.agbplay-gui clean

buildclean:
-cd qtbase && git clean -dxf
-cd qtbase && git clean -dXf
Expand Down

0 comments on commit 2366511

Please sign in to comment.