-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHomescreen.h
More file actions
117 lines (82 loc) · 2.95 KB
/
Homescreen.h
File metadata and controls
117 lines (82 loc) · 2.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
//
// Created by synthly on 10/4/19.
//
#ifndef SYNTHLYOS_HOMESCREEN_H
#define SYNTHLYOS_HOMESCREEN_H
#include "AppHeader.h"
#include "AppFooter.h"
class Homescreen : public Component
{
public:
Homescreen() : header("HOME")
{
//Header
addAndMakeVisible(header, 0);
//Footer
addAndMakeVisible(footer, 0);
//ButtonText
addAndMakeVisible(effects, 0);
addAndMakeVisible(mixer, 0);
addAndMakeVisible(midi, 0);
addAndMakeVisible(waves, 0);
addAndMakeVisible(tracks, 0);
addAndMakeVisible(pattern, 0);
addAndMakeVisible(sampler, 0);
/*
//DrawableText
//effectsName.setColour(Colours::black);
effectsName.setButtonText("Effects");
addAndMakeVisible(effectsName, 0);
//effectsName.setColour(Colours::black);
effectsName.setButtonText("Mixer");
addAndMakeVisible(mixerName, 0);
//effectsName.setColour(Colours::black);
effectsName.setButtonText("Midi");
addAndMakeVisible(midiName, 0);
*/
}
void paint(Graphics& g) override
{
g.setColour(Colours::darkblue);
g.fillRect(buttonArea);
}
void resized() override
{
auto area = getLocalBounds();
//Constants
auto headerHeight = getHeight()/16;
auto footerHeight = getHeight()/12;
header.setBounds(area.removeFromTop(headerHeight));
footer.setBounds(area.removeFromBottom(footerHeight));
/*
//Gather information about main window
auto appButtonWidth = area.getWidth()/3;
auto appButtonHeight = area.getHeight()/3;
auto appTextHeight = appButtonHeight/10;
auto appButtonMargin = appButtonWidth/10;
//SETUP FIRST DRAWER
auto firstDrawer = area.removeFromTop(appButtonHeight+appTextHeight);
//buttonArea = firstDrawer.removeFromLeft(appButtonWidth).reduced(appButtonMargin);
effects.setBounds(firstDrawer.removeFromLeft(appButtonWidth).reduced(appButtonMargin));
mixer.setBounds(firstDrawer.removeFromLeft(appButtonWidth).reduced(appButtonMargin));
midi.setBounds(firstDrawer.removeFromLeft(appButtonWidth).reduced(appButtonMargin));
auto firstTextBars = firstDrawer.removeFromBottom(appTextHeight);
effectsName.setBounds(firstTextBars.removeFromLeft(appButtonWidth));
mixerName.setBounds(firstTextBars.removeFromLeft(appButtonWidth));
midiName.setBounds(firstTextBars.removeFromLeft(appButtonWidth))
effectsName.setBoundsToFit(
buttonArea,
Justification::centred,
false);
*/
}
private:
//Internal Components
TextButton effects, mixer, midi, waves, tracks, pattern, sampler;
TextButton effectsName, mixerName, midiName;
Rectangle<int> buttonArea;
//Child components
AppHeader header;
AppFooter footer;
};
#endif //SYNTHLYOS_HOMESCREEN_H