WIP: I'm not sure what has happened here

Signed-off-by: Nikolai Rodionov <iam@allanger.xyz>
This commit is contained in:
2026-03-19 16:01:03 +01:00
parent a982fc28a6
commit 36c63b42e5
5 changed files with 31 additions and 8 deletions

View File

@@ -23,6 +23,11 @@ endif
headers = [
'src/gui/timeline_view.h'
]
executable('daw-gui', 'src/main.cpp',
src = [
'./src/main.cpp',
'./src/top_bar.cpp',
]
executable('daw-gui', src,
dependencies: [qt_dep, audio_backends_deps],
install: true)

View File

@@ -1,4 +0,0 @@
#include <iostream>
void testtest() {
std::cout << "test" << 'n';
}

View File

@@ -4,6 +4,7 @@
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QSplitter>
#include "top_bar.h"
QFrame* createBox(const QString& name, const QString& color)
{
@@ -22,8 +23,7 @@ int main(int argc, char *argv[])
QWidget window;
// === Top panel (NOT resizable) ===
QFrame* topPanel = createBox("TopPanel", "#87CEFA");
topPanel->setFixedHeight(80); // prevents resizing
TopBar* topBar= new TopBar();
// === Sidebar + Main ===
QFrame* sidebar = createBox("Sidebar", "#90EE90");
@@ -43,7 +43,7 @@ int main(int argc, char *argv[])
// === Main layout ===
QVBoxLayout* layout = new QVBoxLayout(&window);
layout->addWidget(topPanel);
layout->addWidget(topBar);
layout->addWidget(vSplitter);
window.resize(800, 600);

13
src/top_bar.cpp Normal file
View File

@@ -0,0 +1,13 @@
#include "top_bar.h"
#include "qboxlayout.h"
TopBar::TopBar(QWidget* parent)
: QFrame(parent)
{
setFixedHeight(20);
setFrameShape(QFrame::Box);
auto* layout = new QHBoxLayout(this);
layout->setContentsMargins(2, 2, 2, 2);
layout->setSpacing(10);
setStyleSheet("background-color: #87CEFA;");
}

9
src/top_bar.h Normal file
View File

@@ -0,0 +1,9 @@
#pragma once
#include <QWidget>
#include <QFrame>
class TopBar : public QFrame
{
public:
explicit TopBar(QWidget* parent = nullptr);
};