Zoom buttons in the pattern edit should go under the scrolling panel, next to 
the horiz. scrollbar, like in the song edit. (More consistent, and saves 
space too.)

Completed the zooming function of the horizontal ruler.

I also think we should be able to bring the zoom level down another step. 
Implementing that involved changing the type of a property in some of the 
ruler classes from uint to float, but I tested it (a bit) and it doesn't seem 
to do any harm.

There seems to be a slight glitch, though: Sometimes the note property editors 
(pa, velocity and lead/lag) become nonresponsive to the horiz. scrollbar. I 
can't figure out how to reproduce this bug SO PLEASE let me know if you run 
into it, anyone, especially if you can make it happen again :)

Sleep well!
- Jakob.
Index: gui/src/PatternEditor/DrumPatternEditor.cpp
===================================================================
--- gui/src/PatternEditor/DrumPatternEditor.cpp	(revision 220)
+++ gui/src/PatternEditor/DrumPatternEditor.cpp	(working copy)
@@ -645,11 +645,10 @@
 
 void DrumPatternEditor::zoom_out()
 {
-	m_nGridWidth = m_nGridWidth / 2;
-	if (m_nGridWidth < 3) {
-		m_nGridWidth = 3;
+	if ( m_nGridWidth > 1.5 ) {
+		m_nGridWidth = m_nGridWidth / 2;
+		updateEditor();
 	}
-	updateEditor();
 }
 
 
Index: gui/src/PatternEditor/DrumPatternEditor.h
===================================================================
--- gui/src/PatternEditor/DrumPatternEditor.h	(revision 220)
+++ gui/src/PatternEditor/DrumPatternEditor.h	(working copy)
@@ -67,7 +67,7 @@
 		void updateEditor();
 
 	private:
-		uint m_nGridWidth;
+		float m_nGridWidth;
 		uint m_nGridHeight;
 		int m_nEditorHeight;
 		uint m_nResolution;
Index: gui/src/PatternEditor/NotePropertiesRuler.cpp
===================================================================
--- gui/src/PatternEditor/NotePropertiesRuler.cpp	(revision 220)
+++ gui/src/PatternEditor/NotePropertiesRuler.cpp	(working copy)
@@ -708,11 +708,10 @@
 
 void NotePropertiesRuler::zoomOut()
 {
-	m_nGridWidth = m_nGridWidth / 2;
-	if (m_nGridWidth < 3) {
-		m_nGridWidth = 3;
+	if ( m_nGridWidth > 1.5 ) {
+		m_nGridWidth = m_nGridWidth / 2;
+		updateEditor();
 	}
-	updateEditor();
 }
 
 
Index: gui/src/PatternEditor/NotePropertiesRuler.h
===================================================================
--- gui/src/PatternEditor/NotePropertiesRuler.h	(revision 220)
+++ gui/src/PatternEditor/NotePropertiesRuler.h	(working copy)
@@ -57,7 +57,7 @@
 
 		PatternEditorPanel *m_pPatternEditorPanel;
 		H2Core::Pattern *m_pPattern;
-		uint m_nGridWidth;
+		float m_nGridWidth;
 		uint m_nEditorWidth;
 		uint m_nEditorHeight;
 
Index: gui/src/PatternEditor/PatternEditorPanel.cpp
===================================================================
--- gui/src/PatternEditor/PatternEditorPanel.cpp	(revision 220)
+++ gui/src/PatternEditor/PatternEditorPanel.cpp	(working copy)
@@ -173,15 +173,15 @@
 
 
 //wolke some background images hear note rec quant
-	PixmapWidget *pZoom = new PixmapWidget( NULL );
-	pZoom->setFixedSize( 73, 43 );
-	pZoom->setPixmap( "/patternEditor/background_zoom.png" );
-	pZoom->move( 0, 3 );
-	editor_top_hbox_2->addWidget( pZoom );
+// 	PixmapWidget *pZoom = new PixmapWidget( NULL );
+// 	pZoom->setFixedSize( 73, 43 );
+// 	pZoom->setPixmap( "/patternEditor/background_zoom.png" );
+// 	pZoom->move( 0, 3 );
+// 	editor_top_hbox_2->addWidget( pZoom );
 
 	// zoom-in btn
 	Button *zoom_in_btn = new Button(
-			pZoom,
+			NULL,
 			"/songEditor/btn_new_on.png",
 			"/songEditor/btn_new_off.png",
 			"/songEditor/btn_new_over.png",
@@ -196,7 +196,7 @@
 
 	// zoom-out btn
 	Button *zoom_out_btn = new Button(
-			pZoom,
+			NULL,
 			"/songEditor/btn_minus_on.png",
 			"/songEditor/btn_minus_off.png",
 			"/songEditor/btn_minus_over.png",
@@ -355,8 +355,17 @@
 	m_pPatternEditorVScrollBar = new QScrollBar( Qt::Vertical, NULL );
 	connect( m_pPatternEditorVScrollBar, SIGNAL(valueChanged(int)), this, SLOT( syncToExternalHorizontalScrollbar(int) ) );
 
+	QHBoxLayout *pPatternEditorHScrollBarLayout = new QHBoxLayout();
+	pPatternEditorHScrollBarLayout->setSpacing( 0 );
+	pPatternEditorHScrollBarLayout->setMargin( 0 );
+	pPatternEditorHScrollBarLayout->addWidget( m_pPatternEditorHScrollBar );
+	pPatternEditorHScrollBarLayout->addWidget( zoom_in_btn );
+	pPatternEditorHScrollBarLayout->addWidget( zoom_out_btn );
 
+	QWidget *pPatternEditorHScrollBarContainer = new QWidget();
+	pPatternEditorHScrollBarContainer->setLayout( pPatternEditorHScrollBarLayout );
 
+
 	QPalette label_palette;
 	label_palette.setColor( QPalette::Foreground, QColor( 230, 230, 230 ) );
 
@@ -416,7 +425,7 @@
 	pGrid->addWidget( m_pPianoRollScrollView, 2, 1 );
 
 	pGrid->addWidget( m_pPatternEditorVScrollBar, 2, 2 );
-	pGrid->addWidget( m_pPatternEditorHScrollBar, 10, 1 );
+	pGrid->addWidget( pPatternEditorHScrollBarContainer, 10, 1 );
 	pGrid->addWidget( m_pNoteVelocityScrollView, 4, 1 );
 	pGrid->addWidget( m_pNotePanScrollView, 4, 1 );
 	pGrid->addWidget( m_pNoteLeadLagScrollView, 4, 1 );
@@ -786,6 +795,7 @@
 	m_pDrumPatternEditor->zoom_in();
 	m_pNoteVelocityEditor->zoomIn();
 	m_pNoteLeadLagEditor->zoomIn();
+	m_pNotePanEditor->zoomIn();
 
 	resizeEvent( NULL );
 }
@@ -799,6 +809,7 @@
 	m_pDrumPatternEditor->zoom_out();
 	m_pNoteVelocityEditor->zoomOut();
 	m_pNoteLeadLagEditor->zoomOut();
+	m_pNotePanEditor->zoomOut();
 
 	resizeEvent( NULL );
 }
Index: gui/src/PatternEditor/PatternEditorRuler.cpp
===================================================================
--- gui/src/PatternEditor/PatternEditorRuler.cpp	(revision 220)
+++ gui/src/PatternEditor/PatternEditorRuler.cpp	(working copy)
@@ -208,12 +208,16 @@
 
 void PatternEditorRuler::zoomIn()
 {
-	ERRORLOG( "[zoomIn] not implemented yet" );
+	m_nGridWidth *= 2;
+	update();
 }
 
 void PatternEditorRuler::zoomOut()
 {
-	ERRORLOG( "[zoomOut] not implemented yet" );
+	if ( m_nGridWidth > 1.5 ) {
+		m_nGridWidth /= 2;
+		update();
+	}
 }
 
 
Index: gui/src/PatternEditor/PatternEditorRuler.h
===================================================================
--- gui/src/PatternEditor/PatternEditorRuler.h	(revision 220)
+++ gui/src/PatternEditor/PatternEditorRuler.h	(working copy)
@@ -51,7 +51,7 @@
 	private:
 		uint m_nRulerWidth;
 		uint m_nRulerHeight;
-		uint m_nGridWidth;
+		float m_nGridWidth;
 
 		QPixmap *m_pBackground;
 		QPixmap m_tickPosition;
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Hydrogen-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hydrogen-devel

Reply via email to